Last active
August 29, 2015 14:22
-
-
Save d4rky-pl/a34d4ec5d2b40447bcd6 to your computer and use it in GitHub Desktop.
Revisions
-
d4rky-pl revised this gist
May 29, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,14 +8,14 @@ ExecJS.runtime = ExecJS::Runtimes::Node Benchmark.bmbm(20) do |benchmark| benchmark.report('node.js') do 100.times { ExecJS.eval(js_code) } end end ExecJS.runtime = ExecJS::Runtimes::RubyRacer Benchmark.bmbm(20) do |benchmark| benchmark.report('therubyracer') do 100.times { ExecJS.eval(js_code) } end end -
d4rky-pl created this gist
May 29, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ require 'benchmark' require 'execjs' require 'therubyracer' js_code = '2+2' STDOUT.sync = true ExecJS.runtime = ExecJS::Runtimes::Node Benchmark.bmbm(20) do |benchmark| benchmark.report('node.js runtime') do 100.times { ExecJS.eval(js_code) } end end ExecJS.runtime = ExecJS::Runtimes::RubyRacer Benchmark.bmbm(20) do |benchmark| benchmark.report('therubyracer runtime') do 100.times { ExecJS.eval(js_code) } end end # RESULTS: # # Rehearsal ------------------------------------------------ # node.js 0.080000 0.050000 11.200000 ( 11.602124) # -------------------------------------- total: 11.200000sec # # user system total real # node.js 0.070000 0.050000 11.180000 ( 11.570431) # Rehearsal ------------------------------------------------ # therubyracer 0.060000 0.020000 0.080000 ( 0.064798) # --------------------------------------- total: 0.080000sec # # user system total real # therubyracer 0.060000 0.010000 0.070000 ( 0.069190) #