Explorar el Código

Include profile guided optimisation workload.

master
Ian Piumarta hace 1 año
padre
commit
cd992e141e
Se han modificado 1 ficheros con 45 adiciones y 0 borrados
  1. +45
    -0
      profile-generate.txt

+ 45
- 0
profile-generate.txt Ver fichero

@ -0,0 +1,45 @@
nfib = (n) { if (n < 2) 1; else nfib(n-1) + nfib(n-2) + 1; };
then = cputime();
calls = nfib(32);
now = cputime();
secs = now - then;
print(calls, " calls in ",
secs, " seconds = ",
round(calls / secs), " calls/sec\n");
numbers = 8192; // 1028 primes
repeats = 200;
count = 0;
then = cputime();
evals = evaluations();
for (n = 0; n < repeats; n = n + 1) {
print("\r", n, "/", repeats);
let sieve = [];
count = 0;
for (i in numbers) sieve.push(nil);
for (i = 2; i < numbers; i = i + 1) {
if (!sieve[i]) {
// print(i, " ");
count = count + 1;
for (k = i+i; k < numbers; k = k+i)
sieve[k] = #t;
}
}
count;
}
evals = evaluations() - evals;
now = cputime();
secs = now - then;
print("\r", count, " primes in the first ", numbers, " numbers\n");
print(evals, " nodes evaluated in ",
secs, " seconds = ",
round(evals / secs), " nodes/sec\n");

Cargando…
Cancelar
Guardar