Created
July 10, 2014 03:31
-
-
Save alco/5c086a8d52dbd067f4d2 to your computer and use it in GitHub Desktop.
This file contains 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 characters
BenchfellaBench.binary test 10: 10000000 0.13 µs/op | |
BenchfellaBench.binary test 100: 10000000 0.13 µs/op | |
BenchfellaBench.binary test: 10000000 0.13 µs/op | |
BenchfellaBench.binary test 1000: 10000000 0.13 µs/op | |
BenchfellaBench.range test: 100000 26.93 µs/op | |
BenchfellaBench.range test 10: 10000 293.43 µs/op | |
BenchfellaBench.range test 100: 500 3312.59 µs/op | |
BenchfellaBench.range test 1000: 50 32802.00 µs/op |
This file contains 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 characters
@str "Some long string here. It should be much longer than this." | |
@str_10 String.duplicate("Some long string here. It should be much longer than this.", 10) | |
@str_100 String.duplicate("Some long string here. It should be much longer than this.", 100) | |
@str_1000 String.duplicate("Some long string here. It should be much longer than this.", 1000) | |
bench "range test" do | |
String.slice(@str, 10..-10) | |
end | |
bench "binary test" do | |
binary_part(@str, 10, -10) | |
end | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment