From e3ddc2bcc48ba6160455c4ffe35df87715c05693 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Tue, 21 Dec 2010 17:13:07 -0800 Subject: simple perf testing harness with JSON parsing tests - all tests should be under perf/ - all payloads should be under perf/data - run tests with ./server.sh + ./test-perf.sh We still lack a way to compare results against a baseline, but this is better than nothing. --- perf/testUtils.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 perf/testUtils.js (limited to 'perf/testUtils.js') diff --git a/perf/testUtils.js b/perf/testUtils.js new file mode 100644 index 00000000..ca016c31 --- /dev/null +++ b/perf/testUtils.js @@ -0,0 +1,20 @@ +if (window.jstestdriver) { + jstd = jstestdriver; + dump = angular.bind(jstd.console, jstd.console.log); +} + +function time(fn, times) { + times = times || 1; + + var i, + start, + duration = 0; + + for (i=0; i