integrate mode for consistent timing

use with
make t=perftest f='-O3 -DPERF_TEST' c
This commit is contained in:
dzaima 2021-07-30 02:19:15 +03:00
parent b18157d86b
commit 36afe7f533
2 changed files with 18 additions and 7 deletions

View File

@ -55,6 +55,9 @@ int main(int argc, char* argv[]) {
#endif
bool startREPL = argc==1;
bool silentREPL = false;
#ifdef PERF_TEST
silentREPL = true;
#endif
if (!startREPL) {
i32 i = 1;
while (i!=argc) {
@ -171,13 +174,17 @@ int main(int argc, char* argv[]) {
#endif
ptr_dec(block);
#if FORMATTER
B resFmt = bqn_fmt(res);
printRaw(resFmt); dec(resFmt);
putchar('\n');
#ifndef PERF_TEST
#if FORMATTER
B resFmt = bqn_fmt(res);
printRaw(resFmt); dec(resFmt);
putchar('\n');
#else
print(res); putchar('\n'); fflush(stdout);
dec(res);
#endif
#else
print(res); putchar('\n'); fflush(stdout);
dec(res);
dec(res);
#endif
#ifdef HEAP_VERIFY

View File

@ -7,6 +7,10 @@ void hash_init() {
u64 bad1=0xa0761d6478bd642full; // values wyhash64 is afraid of
u64 bad2=0xe7037ed1a0b428dbull;
again:
make_secret(nsTime(), wy_secret);
#ifdef PERF_TEST
make_secret(0, wy_secret);
#else
make_secret(nsTime(), wy_secret);
#endif
for (u64 i = 0; i < 4; i++) if(wy_secret[i]==bad1 || wy_secret[i]==bad2) goto again;
}