diff --git a/benchmark/index.css b/benchmark/index.css
index a4ebb44..9a4b378 100644
--- a/benchmark/index.css
+++ b/benchmark/index.css
@@ -30,5 +30,5 @@ a, a:visited { color: #3d586c; }
background-color: #f0f0f0;
}
#options #run-count { width: 3em; }
-#options #track-line-and-column { margin-left: 2em; }
+#options #cache, #options #track-line-and-column { margin-left: 2em; }
#options #run { width: 5em; margin-left: 2em; }
diff --git a/benchmark/index.html b/benchmark/index.html
index dc1e6cc..5b201e9 100644
--- a/benchmark/index.html
+++ b/benchmark/index.html
@@ -11,6 +11,8 @@
times
+
+
diff --git a/benchmark/index.js b/benchmark/index.js
index e8daa34..a31db56 100644
--- a/benchmark/index.js
+++ b/benchmark/index.js
@@ -63,6 +63,7 @@ $("#run").click(function() {
}
var options = {
+ cache: $("#cache").is(":checked"),
trackLineAndColumn: $("#track-line-and-column").is(":checked")
};
@@ -105,7 +106,7 @@ $("#run").click(function() {
},
start: function() {
- $("#run-count, #track-line-and-column, #run").attr("disabled", "disabled");
+ $("#run-count, #cache, #track-line-and-column, #run").attr("disabled", "disabled");
resultsTable.show();
$("#results-table tr").slice(1).remove();
@@ -122,7 +123,7 @@ $("#run").click(function() {
$.scrollTo("max", { axis: "y", duration: 500 });
- $("#run-count, #track-line-and-column, #run").removeAttr("disabled");
+ $("#run-count, #cache, #track-line-and-column, #run").removeAttr("disabled");
}
});
diff --git a/benchmark/run b/benchmark/run
index 4aa519e..48e9c93 100755
--- a/benchmark/run
+++ b/benchmark/run
@@ -80,6 +80,7 @@ function printHelp() {
util.puts("");
util.puts("Options:");
util.puts(" -n, --run-count number of runs (default: 10)");
+ util.puts(" --cache make tested parsers cache results");
util.puts(" --track-line-and-column make tested parsers track line and column");
}
@@ -127,6 +128,10 @@ while (args.length > 0 && isOption(args[0])) {
}
break;
+ case "--cache":
+ options.cache = true;
+ break;
+
case "--track-line-and-column":
options.trackLineAndColumn = true;
break;