We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c71fd12 commit b2b6e80Copy full SHA for b2b6e80
1 file changed
benchmark/table.yaml
@@ -0,0 +1,27 @@
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')
0 commit comments