Commit 8caa5dc3 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent c4ccc23c
...@@ -55,13 +55,16 @@ int main() { ...@@ -55,13 +55,16 @@ int main() {
perror("fallocate"); perror("fallocate");
abort(); abort();
} }
printf("T(fallocate): %.1f\n", Tend - Tstart); // XXX print per page? printf("T(fallocate):\t%.1f\t%6.1f ns / page\n", Tend - Tstart, (Tend - Tstart) * 1E9 / NITER);
Tstart = microtime();
addr = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); addr = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
if (addr == MAP_FAILED) { if (addr == MAP_FAILED) {
perror("mmap"); perror("mmap");
abort(); abort();
} }
Tend = microtime();
printf("T(mmap):\t%.1f\t%6.1f ns / page\n", Tend - Tstart, (Tend - Tstart) * 1E9 / NITER);
Tstart = microtime(); Tstart = microtime();
for (i=0; i<NITER; i++) { for (i=0; i<NITER; i++) {
...@@ -69,7 +72,7 @@ int main() { ...@@ -69,7 +72,7 @@ int main() {
} }
Tend = microtime(); Tend = microtime();
printf("T(pagefault): %.1f ns\t(%i)\n", (Tend - Tstart) * 1E9 / NITER, sum); printf("T(pagefault):\t%.1f\t%6.1f ns / page\t(%i)\n", Tend - Tstart, (Tend - Tstart) * 1E9 / NITER, sum);
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment