Skip to content

Instantly share code, notes, and snippets.

@razielgn
Created October 14, 2013 11:45
Show Gist options
  • Save razielgn/6974400 to your computer and use it in GitHub Desktop.
Save razielgn/6974400 to your computer and use it in GitHub Desktop.
=== bin/rbx ===
parse '2011-03-08' 20178.8 (±23.6%) i/s - 94600 in 5.034218s (cycle=1100)
parse '2011-03-08T10:09'
4068.3 (±7.4%) i/s - 20196 in 5.000597s (cycle=396)
parse '2011-03-08T10:09:08'
4130.0 (±6.9%) i/s - 20570 in 5.011233s (cycle=374)
parse '2011-03-08T10:09:08.467'
3796.4 (±10.7%) i/s - 18980 in 5.075889s (cycle=365)
parse '2011-Mar-08T10:09'
3895.3 (±3.4%) i/s - 19663 in 5.053905s (cycle=371)
parse '2011-Mar-08T10:09:08'
3826.7 (±7.0%) i/s - 19188 in 5.050746s (cycle=369)
parse '2011-Mar-08T10:09:08.467'
3698.1 (±8.1%) i/s - 18616 in 5.081049s (cycle=358)
parse '08 Mar 11' 18602.2 (±4.3%) i/s - 93081 in 5.014135s (cycle=1349)
parse '08 Mar 11 10:09:08 GMT'
3537.3 (±11.4%) i/s - 17595 in 5.076124s (cycle=345)
parse '08 Mar 11 10:09:08 CST'
3449.4 (±12.3%) i/s - 16905 in 5.014729s (cycle=345)
parse 'Fri Jan 02 08:10:00 -0600 2004'
3207.3 (±3.1%) i/s - 16116 in 5.029947s (cycle=316)
parse 'Fri, 02 Jan 2004 08:10:00 -0600'
3282.8 (±5.5%) i/s - 16371 in 5.008067s (cycle=321)
parse '2011/03/08 10:09:08 -0600'
2219.2 (±3.7%) i/s - 11128 in 5.021844s (cycle=214)
fixnum Time#to_i 49769774.1 (±2.9%) i/s - 247640889 in 4.980637s (cycle=230793)
fixnum Time#to_f 3950342.9 (±2.8%) i/s - 19754244 in 5.004905s (cycle=101826)
float Time#to_i 56094219.6 (±6.3%) i/s - 277507456 in 4.976560s (cycle=223616)
float Time#to_f 453182.7 (±2.9%) i/s - 2263590 in 4.999407s (cycle=25151)
Comparison:
float Time#to_i: 56094219.6 i/s
fixnum Time#to_i: 49769774.1 i/s - 1.13x slower
fixnum Time#to_f: 3950342.9 i/s - 14.20x slower
float Time#to_f: 453182.7 i/s - 123.78x slower
#at with integer 8122356.2 (±3.5%) i/s - 40485500 in 4.993237s (cycle=161942)
#at with float 99611.1 (±9.4%) i/s - 488240 in 4.996052s (cycle=2872)
time < time, (fixnum <=> fixnum)
10657125.1 (±2.8%) i/s - 53312389 in 5.007803s (cycle=158197)
time <= time, (fixnum <=> fixnum)
13666328.3 (±3.7%) i/s - 68216642 in 5.001791s (cycle=180946)
time == time, (fixnum <=> fixnum)
12730873.3 (±3.1%) i/s - 63580842 in 5.000382s (cycle=181142)
time >= time, (fixnum <=> fixnum)
13752097.3 (±2.7%) i/s - 68737032 in 5.002374s (cycle=188838)
time > time, (fixnum <=> fixnum)
13581727.1 (±4.9%) i/s - 67717635 in 5.001611s (cycle=196283)
time < time, (float <=> float)
13572670.2 (±5.8%) i/s - 67497130 in 4.995523s (cycle=191210)
time <= time, (float <=> float)
13147935.5 (±6.7%) i/s - 65385648 in 5.002560s (cycle=173898)
time == time, (float <=> float)
29359371.2 (±5.2%) i/s - 146052582 in 4.993820s (cycle=205998)
time >= time, (float <=> float)
12916058.0 (±5.1%) i/s - 64297727 in 4.994753s (cycle=170551)
time > time, (float <=> float)
13633554.7 (±4.3%) i/s - 68022224 in 5.000422s (cycle=184843)
time < time, (fixnum <=> float)
13322618.9 (±4.9%) i/s - 66487122 in 5.007398s (cycle=189422)
time <= time, (fixnum <=> float)
13440605.9 (±5.2%) i/s - 66968300 in 4.998942s (cycle=193550)
time == time, (fixnum <=> float)
12542258.8 (±5.1%) i/s - 62551610 in 5.003764s (cycle=180785)
time >= time, (fixnum <=> float)
13770099.3 (±2.4%) i/s - 68826560 in 5.001872s (cycle=195530)
time > time, (fixnum <=> float)
13781338.9 (±2.3%) i/s - 68972640 in 5.007797s (cycle=195945)
Comparison:
time == time, (float <=> float): 29359371.2 i/s
time > time, (fixnum <=> float): 13781338.9 i/s - 2.13x slower
time >= time, (fixnum <=> float): 13770099.3 i/s - 2.13x slower
time >= time, (fixnum <=> fixnum): 13752097.3 i/s - 2.13x slower
time <= time, (fixnum <=> fixnum): 13666328.3 i/s - 2.15x slower
time > time, (float <=> float): 13633554.7 i/s - 2.15x slower
time > time, (fixnum <=> fixnum): 13581727.1 i/s - 2.16x slower
time < time, (float <=> float): 13572670.2 i/s - 2.16x slower
time <= time, (fixnum <=> float): 13440605.9 i/s - 2.18x slower
time < time, (fixnum <=> float): 13322618.9 i/s - 2.20x slower
time <= time, (float <=> float): 13147935.5 i/s - 2.23x slower
time >= time, (float <=> float): 12916058.0 i/s - 2.27x slower
time == time, (fixnum <=> fixnum): 12730873.3 i/s - 2.31x slower
time == time, (fixnum <=> float): 12542258.8 i/s - 2.34x slower
time < time, (fixnum <=> fixnum): 10657125.1 i/s - 2.75x slower
Time#now 18271810.7 (±4.2%) i/s - 90869166 in 4.986884s (cycle=222174)
#strftime short string
306163.6 (±7.3%) i/s - 1524096 in 5.012357s (cycle=21168)
#strftime large string
2124.3 (±3.9%) i/s - 10712 in 5.051509s (cycle=206)
=== bin/rbx ===
parse '2011-03-08' 17155.3 (±27.4%) i/s - 78933 in 4.998237s (cycle=951)
parse '2011-03-08T10:09'
3804.0 (±13.8%) i/s - 18669 in 5.031009s (cycle=381)
parse '2011-03-08T10:09:08'
3940.9 (±6.4%) i/s - 19665 in 5.012606s (cycle=345)
parse '2011-03-08T10:09:08.467'
3655.6 (±13.0%) i/s - 18032 in 5.046056s (cycle=368)
parse '2011-Mar-08T10:09'
3739.9 (±9.4%) i/s - 18462 in 5.000283s (cycle=362)
parse '2011-Mar-08T10:09:08'
3747.3 (±6.8%) i/s - 18819 in 5.054308s (cycle=369)
parse '2011-Mar-08T10:09:08.467'
3651.2 (±6.4%) i/s - 18360 in 5.060397s (cycle=360)
parse '08 Mar 11' 18083.3 (±5.5%) i/s - 91512 in 5.080345s (cycle=1476)
parse '08 Mar 11 10:09:08 GMT'
3486.5 (±10.0%) i/s - 17340 in 5.048386s (cycle=340)
parse '08 Mar 11 10:09:08 CST'
3386.1 (±10.6%) i/s - 16954 in 5.086447s (cycle=346)
parse 'Fri Jan 02 08:10:00 -0600 2004'
3093.6 (±4.6%) i/s - 15657 in 5.073904s (cycle=307)
parse 'Fri, 02 Jan 2004 08:10:00 -0600'
3178.4 (±6.5%) i/s - 15953 in 5.050029s (cycle=301)
parse '2011/03/08 10:09:08 -0600'
2149.5 (±3.9%) i/s - 10908 in 5.082597s (cycle=202)
fixnum Time#to_i 49438367.6 (±5.2%) i/s - 245102277 in 4.974410s (cycle=223023)
fixnum Time#to_f 3082060.8 (±3.2%) i/s - 15365547 in 4.991348s (cycle=86811)
float Time#to_i 49377855.5 (±5.8%) i/s - 244614042 in 4.979245s (cycle=235659)
float Time#to_f 427603.7 (±4.3%) i/s - 2150596 in 5.040333s (cycle=24164)
Comparison:
fixnum Time#to_i: 49438367.6 i/s
float Time#to_i: 49377855.5 i/s - 1.00x slower
fixnum Time#to_f: 3082060.8 i/s - 16.04x slower
float Time#to_f: 427603.7 i/s - 115.62x slower
#at with integer 8022260.4 (±3.4%) i/s - 40064444 in 5.000758s (cycle=168338)
#at with float 102946.6 (±8.1%) i/s - 512421 in 5.038156s (cycle=5631)
time < time, (fixnum <=> fixnum)
9534002.2 (±4.3%) i/s - 47625875 in 5.007872s (cycle=173185)
time <= time, (fixnum <=> fixnum)
12150613.2 (±3.5%) i/s - 60617970 in 4.995915s (cycle=160365)
time == time, (fixnum <=> fixnum)
11141022.7 (±2.1%) i/s - 55798900 in 5.010823s (cycle=192410)
time >= time, (fixnum <=> fixnum)
11827238.6 (±8.7%) i/s - 58684500 in 5.008846s (cycle=181125)
time > time, (fixnum <=> fixnum)
11645342.4 (±5.6%) i/s - 57917916 in 4.992013s (cycle=178759)
time < time, (float <=> float)
11914451.4 (±3.8%) i/s - 59389687 in 4.994479s (cycle=183869)
time <= time, (float <=> float)
12292292.9 (±3.5%) i/s - 61376350 in 5.003824s (cycle=175361)
time == time, (float <=> float)
31875030.6 (±3.9%) i/s - 158719374 in 4.989148s (cycle=223234)
time >= time, (float <=> float)
11556857.7 (±3.5%) i/s - 57761292 in 5.004929s (cycle=172938)
time > time, (float <=> float)
9879077.8 (±2.7%) i/s - 49467910 in 5.011481s (cycle=170579)
time < time, (fixnum <=> float)
11363881.3 (±2.1%) i/s - 56749924 in 4.996272s (cycle=184253)
time <= time, (fixnum <=> float)
12298573.9 (±3.9%) i/s - 61445365 in 5.006287s (cycle=183419)
time == time, (fixnum <=> float)
11234834.0 (±1.6%) i/s - 56244376 in 5.007586s (cycle=162556)
time >= time, (fixnum <=> float)
11055796.0 (±5.3%) i/s - 55148640 in 5.006632s (cycle=181410)
time > time, (fixnum <=> float)
12370441.4 (±2.8%) i/s - 61794656 in 5.000564s (cycle=181216)
Comparison:
time == time, (float <=> float): 31875030.6 i/s
time > time, (fixnum <=> float): 12370441.4 i/s - 2.58x slower
time <= time, (fixnum <=> float): 12298573.9 i/s - 2.59x slower
time <= time, (float <=> float): 12292292.9 i/s - 2.59x slower
time <= time, (fixnum <=> fixnum): 12150613.2 i/s - 2.62x slower
time < time, (float <=> float): 11914451.4 i/s - 2.68x slower
time >= time, (fixnum <=> fixnum): 11827238.6 i/s - 2.70x slower
time > time, (fixnum <=> fixnum): 11645342.4 i/s - 2.74x slower
time >= time, (float <=> float): 11556857.7 i/s - 2.76x slower
time < time, (fixnum <=> float): 11363881.3 i/s - 2.80x slower
time == time, (fixnum <=> float): 11234834.0 i/s - 2.84x slower
time == time, (fixnum <=> fixnum): 11141022.7 i/s - 2.86x slower
time >= time, (fixnum <=> float): 11055796.0 i/s - 2.88x slower
time > time, (float <=> float): 9879077.8 i/s - 3.23x slower
time < time, (fixnum <=> fixnum): 9534002.2 i/s - 3.34x slower
Time#now 17997577.2 (±4.6%) i/s - 89527914 in 4.989505s (cycle=216251)
#strftime short string
289732.1 (±4.2%) i/s - 1448448 in 5.009523s (cycle=20992)
#strftime large string
2097.0 (±2.0%) i/s - 10608 in 5.060596s (cycle=208)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment