Skip to content

Instantly share code, notes, and snippets.

@ssnickolay
Last active July 24, 2020 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssnickolay/249ca69305c0a51b5ff1ef48b0340687 to your computer and use it in GitHub Desktop.
Save ssnickolay/249ca69305c0a51b5ff1ef48b0340687 to your computer and use it in GitHub Desktop.
# jt -u jvm-ce benchmark -e 'string = "a:" * 500_000; benchmark { string.split(":") }'
1.2712554515493182
2.160920504253029
17.192892688457704
61.5012920434102
77.74676398417816
82.08563672136926
79.00306258772991
84.1567876139306
83.73938168950544
84.3295603440849
84.90500207796002
87.29870319536553
87.34425918477079
# jt -u jvm-ce benchmark -e 'string = "a:" * 500_000; benchmark { arr = []; string.split(":") {|e| arr << e} }'
1.6775865726295065
7.85006403169612
30.684028173768695
45.230951318510265
47.93623254070432
50.207803960653465
49.06903223937734
50.2554031377233
52.00429682217744
51.63648749291007
53.854072165720176
51.30308614200201
52.5127787290565
# jt -u jvm-ce benchmark -e 'string = "a:" * 500_000; benchmark { string.split(":") { |e| } }'
1.2159786812054363
2.8066044195490005
9.416124924250898
51.60747123905944
56.26877565220941
56.807241294450854
56.28343029892998
59.07268178794763
58.754281547181
59.46445516066874
60.77559842780783
60.492331053301704
60.12677646410276
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment