File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ loop_count : 100
2
+ contexts :
3
+ - gems :
4
+ csv : 3.3.0
5
+ - name : " master"
6
+ prelude : |
7
+ $LOAD_PATH.unshift(File.expand_path("lib"))
8
+ require "csv"
9
+ prelude : |-
10
+ n_columns = Integer(ENV.fetch("N_COLUMNS", "5"), 10)
11
+ n_rows = Integer(ENV.fetch("N_ROWS", "100"), 10)
12
+ fields = ["AAAAA"] * n_columns
13
+ headers = n_columns.times.collect do |i|
14
+ "header#{i}"
15
+ end
16
+ row = CSV::Row.new(headers, fields)
17
+ rows = [row] * n_rows
18
+ table = CSV::Table.new(rows)
19
+ rows = [row] * n_rows * 10
20
+ large_table = CSV::Table.new(rows)
21
+ benchmark :
22
+ " to_csv: no encoding " : |-
23
+ table.to_csv
24
+ " to_csv: encoding " : |-
25
+ table.to_csv(encoding : ' UTF-8' )
26
+ " to_csv: encoding - 10 x rows " : |-
27
+ large_table.to_csv(encoding : ' UTF-8' )
You can’t perform that action at this time.
0 commit comments