Last active
December 4, 2018 17:45
-
-
Save 284km/56b4e8444e8778ed8132ef663a93f5dc to your computer and use it in GitHub Desktop.
benchmark of "Replace with flexible CSV parser"
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 characters
``` | |
$ rake | |
Run options: | |
# Running tests: | |
Finished tests in 1.893467s, 224.9841 tests/s, 4058.1642 assertions/s. | |
426 tests, 7684 assertions, 0 failures, 0 errors, 0 skips | |
ruby -v: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin17] | |
$ | |
``` | |
``` | |
$ ruby benchmark/parse.rb | |
# https://github.com/284km/csv/blob/scanner/benchmark/parse.rb | |
# after Replace | |
Warming up -------------------------------------- | |
unquoted 3.000 i/100ms | |
quoted 2.000 i/100ms | |
include col_sep 1.000 i/100ms | |
include row_sep 1.000 i/100ms | |
encode utf-8 2.000 i/100ms | |
encode sjis 3.000 i/100ms | |
Calculating ------------------------------------- | |
unquoted 38.104 (± 7.9%) i/s - 192.000 in 5.073586s | |
quoted 21.494 (± 9.3%) i/s - 108.000 in 5.076472s | |
include col_sep 13.366 (± 7.5%) i/s - 66.000 in 5.018670s | |
include row_sep 6.601 (± 0.0%) i/s - 33.000 in 5.009123s | |
encode utf-8 31.722 (± 3.2%) i/s - 160.000 in 5.053156s | |
encode sjis 31.669 (± 3.2%) i/s - 159.000 in 5.029365s | |
# before Replace | |
Warming up -------------------------------------- | |
unquoted 3.000 i/100ms | |
quoted 2.000 i/100ms | |
include col_sep 1.000 i/100ms | |
include row_sep 1.000 i/100ms | |
encode utf-8 3.000 i/100ms | |
encode sjis 3.000 i/100ms | |
Calculating ------------------------------------- | |
unquoted 38.655 (± 5.2%) i/s - 195.000 in 5.054174s | |
quoted 21.448 (± 4.7%) i/s - 108.000 in 5.041851s | |
include col_sep 13.731 (± 0.0%) i/s - 69.000 in 5.030303s | |
include row_sep 6.732 (± 0.0%) i/s - 34.000 in 5.056854s | |
encode utf-8 31.144 (± 3.2%) i/s - 156.000 in 5.014613s | |
encode sjis 33.007 (± 3.0%) i/s - 165.000 in 5.010195s | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment