Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1058)

Unified Diff: nacl/bench-framework.c

Issue 7821018: Add Richards and DeltaBlue benchmarks (Closed) Base URL: https://code.google.com/p/web-shootout/@master
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nacl/bench-framework.h ('k') | nacl/build.scons » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nacl/bench-framework.c
diff --git a/nacl/bench-framework.c b/nacl/bench-framework.c
index 2a63db0c68cc1144eea2f24f6f116d0935adc2ab..437c59cc93971fb415dabd196e78d58b6e303c2c 100644
--- a/nacl/bench-framework.c
+++ b/nacl/bench-framework.c
@@ -18,6 +18,10 @@ enum run_model_t { kRunModelRepeated, kRunModelOnce };
static enum run_model_t run_model;
void RegisterBenchmark(char *name, bench_function entry, int param, int time_ref) {
+ if (benchmark_count == MAX_BENCHMARKS) {
+ ReportStatus("Too many benchmarks. Increase MAX_BENCHMARKS in framework\n");
+ exit(1);
+ }
bench_info_list[benchmark_count].name = name;
bench_info_list[benchmark_count].run = entry;
bench_info_list[benchmark_count].time_ref = time_ref;
@@ -71,6 +75,7 @@ static void RunAll() {
RunOne(bi, rd);
usec_per_run = (double)rd->elapsed / (double)rd->runs;
rd->score = 100.0 * bi->time_ref / usec_per_run;
+ printf("usec_per_run %f\n", usec_per_run);
ReportStatus("%s: %d", bi->name, (int)rd->score);
}
started = 0;
@@ -98,6 +103,8 @@ static double GeometricMean() {
}
void SetupSmallBenchmarks() {
+ RegisterBenchmark(strdup("Richards"), run_richards, 10000, 35302);
+ RegisterBenchmark(strdup("Deltablue"), run_deltablue, 100, 66118);
RegisterBenchmark(strdup("Fannkuchredux"), run_fannkuch, 10, 64052288);
RegisterBenchmark(strdup("Nbody"), run_nbody, 1000000, 73000000);
RegisterBenchmark(strdup("Spectralnorm"), run_spectralnorm, 350, 150020779);
@@ -110,6 +117,8 @@ void SetupSmallBenchmarks() {
}
void SetupLargeBenchmarks() {
+ RegisterBenchmark(strdup("Richards"), run_richards, 1000000, 35302);
+ RegisterBenchmark(strdup("Deltablue"), run_deltablue, 10000, 66118);
RegisterBenchmark(strdup("Fannkuchredux"), run_fannkuch, 11, 64052288);
RegisterBenchmark(strdup("Nbody"), run_nbody, 10000000, 73000000);
RegisterBenchmark(strdup("Spectralnorm"), run_spectralnorm, 5500, 150020779);
« no previous file with comments | « nacl/bench-framework.h ('k') | nacl/build.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698