summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-05-10 10:39:30 -0600
committermo khan <mo.khan@gmail.com>2020-05-10 10:39:30 -0600
commit2438ab1c4824f3381c9f62ec5015b63052e2c520 (patch)
tree0103b5b85507ee71d81b804168f0d27281bbec82 /bin
parentb2ea3e84a6ec775ceda0e64b1045085444755f06 (diff)
Fix linter errors and update licensed cache
Diffstat (limited to 'bin')
-rwxr-xr-xbin/csv-benchmark15
1 files changed, 8 insertions, 7 deletions
diff --git a/bin/csv-benchmark b/bin/csv-benchmark
index f7573f2..dc0bb80 100755
--- a/bin/csv-benchmark
+++ b/bin/csv-benchmark
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
+# frozen_string_literal: true
require 'bundler/inline'
@@ -15,14 +16,14 @@ require 'csv'
require 'fastcsv'
require 'fastest-csv'
-csv = "\"spandx\",\"0.0.0\",\"MIT\""
+csv = '"spandx","0.0.0","MIT"'
Benchmark.ips do |x|
- x.report("CSV.parse") { CSV.parse(csv)[0] }
- x.report("csv.split") { csv.split(',', 3) }
- x.report("csv.split-with-slice") { csv.chomp.split(',', 3).slice(1...-1) }
- x.report("csv.regex") { csv.scan(/"(\S+)","*(\d+.\d+.\d+)","(\S+)"/)[0] }
- x.report("csv.fastcsv") { FastCSV.raw_parse(csv) { |x| x } }
- x.report("csv.fastestcsv") { FastestCSV.parse_line(csv) }
+ x.report('CSV.parse') { CSV.parse(csv)[0] }
+ x.report('csv.split') { csv.split(',', 3) }
+ x.report('csv.split-with-slice') { csv.chomp.split(',', 3).slice(1...-1) }
+ x.report('csv.regex') { csv.scan(/"(\S+)","*(\d+.\d+.\d+)","(\S+)"/)[0] }
+ x.report('csv.fastcsv') { FastCSV.raw_parse(csv) { |y| y } }
+ x.report('csv.fastestcsv') { FastestCSV.parse_line(csv) }
x.compare!
end