From 5f90dc58773998e32bc547e3799c6fcbe19dcd5c Mon Sep 17 00:00:00 2001 From: Gabriel Llamas Date: Wed, 16 Oct 2013 20:55:09 +0200 Subject: [PATCH] updated typeof --- examples/typeof.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/typeof.js b/examples/typeof.js index d908cf3..a14c76e 100644 --- a/examples/typeof.js +++ b/examples/typeof.js @@ -4,6 +4,8 @@ var speedy = require ("../lib"); var s = "string"; +//1 closure lookup and 1 variable definition per test + speedy.run ({ cache: function (){ var type = typeof s; @@ -11,8 +13,9 @@ speedy.run ({ type === "string"; }, "no-cache": function (){ - typeof s === "number"; - typeof s === "string"; + var str = s; + typeof str === "number"; + typeof str === "string"; } }); @@ -21,7 +24,7 @@ File: typeof.js Node v0.10.20 V8 v3.14.5.9 -Speedy v0.1.0 +Speedy v0.1.1 Tests: 2 Timeout: 1000ms (1s 0ms) @@ -32,9 +35,9 @@ Total time: ~6000ms (6s 0ms) Higher is better (ops/sec) cache - 82,349,483 ± 0.0% + 82,518,276 ± 0.0% no-cache - 147,240,709 ± 0.0% + 148,560,774 ± 0.0% -Elapsed time: 6147ms (6s 147ms) +Elapsed time: 6054ms (6s 54ms) */ \ No newline at end of file