Skip to content

Instantly share code, notes, and snippets.

@headius
Last active December 7, 2018 17:42
Show Gist options
  • Save headius/6689b1168d9563ddf5a9bd12698927bd to your computer and use it in GitHub Desktop.
Save headius/6689b1168d9563ddf5a9bd12698927bd to your computer and use it in GitHub Desktop.
[] ~/projects/jruby $ pickjdk 5
New JDK: jdk1.8.0_181.jdk
[] ~/projects/jruby $ ruby -e "def foo(depth); if depth > 0; foo(depth-1); else; caller(1, 1); end; end; loop { t = Time.now; i = 0; while i < 10000; i+=1; foo(500); end; puts Time.now - t }"
6.830108
6.658895
6.652521
^C
[] ~/projects/jruby $ pickjdk 4
New JDK: jdk-9.0.4.jdk
[] ~/projects/jruby $ ruby -e "def foo(depth); if depth > 0; foo(depth-1); else; caller(1, 1); end; end; loop { t = Time.now; i = 0; while i < 10000; i+=1; foo(500); end; puts Time.now - t }"
0.7939510000000001
0.534942
0.419912
0.41124
0.392579
0.388477
0.387344
0.380383
0.380637
0.40394100000000005
0.391761
^C
[] ~/projects/jruby $ rvm ruby-2.5.1 do ruby -e "def foo(depth); if depth > 0; foo(depth-1); else; caller(1, 1); end; end; loop { t = Time.now; i = 0; while i < 10000; i+=1; foo(500); end; puts Time.now - t }"
0.2282
0.205485
0.204644
0.200697
0.20538
0.198279
0.200808
0.200894
0.203186
0.20651
0.204906
0.201471
0.202154
0.203662
0.200463
0.199608
0.20231
^C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment