osheet-xmlss 1.0.0.rc.1 → 1.0.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -18,3 +18,4 @@ spec/reports
18
18
  test/tmp
19
19
  test/version_tmp
20
20
  tmp
21
+ bench/*_100*.xls
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ namespace :bench do
19
19
  task :profiler do
20
20
  require 'bench/profiler_runner'
21
21
  runner = OsheetXmlssProfilerRunner.new(1000)
22
- runner.print_flat(STDOUT, :min_percent => 3)
22
+ runner.print_flat(STDOUT, :min_percent => 1)
23
23
  end
24
24
 
25
25
  desc "Run the example workbook builds."
@@ -16,18 +16,14 @@ class OsheetXmlssBenchResults
16
16
 
17
17
  def run
18
18
  @runner.run do
19
- data_values = {
20
- :number => 1,
21
- :text => 'text',
22
- :currency => 123.45,
23
- :text => "<>&'\"/",
24
- :currency => 45.23
25
- }
26
-
27
- outstream = StringIO.new(out = "")
28
- outstream << Osheet::Workbook.new(Osheet::XmlssWriter.new(:pp => 2), {
19
+ Osheet::Workbook.new(Osheet::XmlssWriter.new(:pp => 2), {
29
20
  :bench_row_count => @row_count,
30
- :runner => @runner
21
+ :runner => @runner,
22
+ :data_values => {
23
+ 'number' => 1,
24
+ 'currency' => 45.23,
25
+ 'text' => "<>&'\"/"
26
+ }
31
27
  }) {
32
28
  title "bench"
33
29
 
@@ -51,7 +47,7 @@ class OsheetXmlssBenchResults
51
47
  worksheet {
52
48
  name "bench results"
53
49
 
54
- data_values.keys.each do |label|
50
+ data_values.keys.sort.each do |label|
55
51
  column {
56
52
  width 200
57
53
  meta(:label => label)
@@ -60,14 +56,15 @@ class OsheetXmlssBenchResults
60
56
 
61
57
  row :header
62
58
 
63
- 10.times do |i|
64
- (bench_row_count / 10).times do
59
+ # 10.times do |i|
60
+ # (bench_row_count / 10).times do
61
+ bench_row_count.times do
65
62
  row :data, data_values
66
63
  end
67
- runner.snapshot("#{((i+1)*10).to_s.rjust(3)}%")
68
- end
64
+ # runner.snapshot("#{((i+1)*10).to_s.rjust(3)}%")
65
+ # end
69
66
  }
70
- }.to_data
67
+ }.to_file("./bench/bench_runner_#{@row_count}.xls")
71
68
  end
72
69
  end
73
70
 
@@ -75,7 +72,7 @@ end
75
72
 
76
73
  class OsheetXmlssBenchRunner
77
74
 
78
- ROWS = [10, 100, 1000]#, 10000]#, 30000]
75
+ ROWS = [1_000]#, 100, 1_000, 10_000, 100_000]
79
76
 
80
77
  def initialize
81
78
  puts "Benchmark Results:"
@@ -0,0 +1,142 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
3
+ <Styles>
4
+ <Style ss:ID="..currency_dollar_2_comma_black">
5
+ <NumberFormat ss:Format="&quot;$&quot;#,##0.00" />
6
+ </Style>
7
+ <Style ss:ID="..number_none_0_nocomma_black">
8
+ <NumberFormat ss:Format="0" />
9
+ </Style>
10
+ <Style ss:ID="..text">
11
+ <NumberFormat ss:Format="@" />
12
+ </Style>
13
+ </Styles>
14
+ <Worksheet ss:Name="bench results">
15
+ <Table>
16
+ <Column ss:Width="200" />
17
+ <Column ss:Width="200" />
18
+ <Column ss:Width="200" />
19
+ <Row>
20
+ <Cell>
21
+ <Data ss:Type="String">currency</Data>
22
+ </Cell>
23
+ <Cell>
24
+ <Data ss:Type="String">number</Data>
25
+ </Cell>
26
+ <Cell>
27
+ <Data ss:Type="String">text</Data>
28
+ </Cell>
29
+ </Row>
30
+ <Row>
31
+ <Cell ss:StyleID="..currency_dollar_2_comma_black">
32
+ <Data ss:Type="Number">45.23</Data>
33
+ </Cell>
34
+ <Cell ss:StyleID="..number_none_0_nocomma_black">
35
+ <Data ss:Type="Number">1</Data>
36
+ </Cell>
37
+ <Cell ss:StyleID="..text">
38
+ <Data ss:Type="String">&lt;&gt;&amp;&#x27;&quot;&#x2F;</Data>
39
+ </Cell>
40
+ </Row>
41
+ <Row>
42
+ <Cell ss:StyleID="..currency_dollar_2_comma_black">
43
+ <Data ss:Type="Number">45.23</Data>
44
+ </Cell>
45
+ <Cell ss:StyleID="..number_none_0_nocomma_black">
46
+ <Data ss:Type="Number">1</Data>
47
+ </Cell>
48
+ <Cell ss:StyleID="..text">
49
+ <Data ss:Type="String">&lt;&gt;&amp;&#x27;&quot;&#x2F;</Data>
50
+ </Cell>
51
+ </Row>
52
+ <Row>
53
+ <Cell ss:StyleID="..currency_dollar_2_comma_black">
54
+ <Data ss:Type="Number">45.23</Data>
55
+ </Cell>
56
+ <Cell ss:StyleID="..number_none_0_nocomma_black">
57
+ <Data ss:Type="Number">1</Data>
58
+ </Cell>
59
+ <Cell ss:StyleID="..text">
60
+ <Data ss:Type="String">&lt;&gt;&amp;&#x27;&quot;&#x2F;</Data>
61
+ </Cell>
62
+ </Row>
63
+ <Row>
64
+ <Cell ss:StyleID="..currency_dollar_2_comma_black">
65
+ <Data ss:Type="Number">45.23</Data>
66
+ </Cell>
67
+ <Cell ss:StyleID="..number_none_0_nocomma_black">
68
+ <Data ss:Type="Number">1</Data>
69
+ </Cell>
70
+ <Cell ss:StyleID="..text">
71
+ <Data ss:Type="String">&lt;&gt;&amp;&#x27;&quot;&#x2F;</Data>
72
+ </Cell>
73
+ </Row>
74
+ <Row>
75
+ <Cell ss:StyleID="..currency_dollar_2_comma_black">
76
+ <Data ss:Type="Number">45.23</Data>
77
+ </Cell>
78
+ <Cell ss:StyleID="..number_none_0_nocomma_black">
79
+ <Data ss:Type="Number">1</Data>
80
+ </Cell>
81
+ <Cell ss:StyleID="..text">
82
+ <Data ss:Type="String">&lt;&gt;&amp;&#x27;&quot;&#x2F;</Data>
83
+ </Cell>
84
+ </Row>
85
+ <Row>
86
+ <Cell ss:StyleID="..currency_dollar_2_comma_black">
87
+ <Data ss:Type="Number">45.23</Data>
88
+ </Cell>
89
+ <Cell ss:StyleID="..number_none_0_nocomma_black">
90
+ <Data ss:Type="Number">1</Data>
91
+ </Cell>
92
+ <Cell ss:StyleID="..text">
93
+ <Data ss:Type="String">&lt;&gt;&amp;&#x27;&quot;&#x2F;</Data>
94
+ </Cell>
95
+ </Row>
96
+ <Row>
97
+ <Cell ss:StyleID="..currency_dollar_2_comma_black">
98
+ <Data ss:Type="Number">45.23</Data>
99
+ </Cell>
100
+ <Cell ss:StyleID="..number_none_0_nocomma_black">
101
+ <Data ss:Type="Number">1</Data>
102
+ </Cell>
103
+ <Cell ss:StyleID="..text">
104
+ <Data ss:Type="String">&lt;&gt;&amp;&#x27;&quot;&#x2F;</Data>
105
+ </Cell>
106
+ </Row>
107
+ <Row>
108
+ <Cell ss:StyleID="..currency_dollar_2_comma_black">
109
+ <Data ss:Type="Number">45.23</Data>
110
+ </Cell>
111
+ <Cell ss:StyleID="..number_none_0_nocomma_black">
112
+ <Data ss:Type="Number">1</Data>
113
+ </Cell>
114
+ <Cell ss:StyleID="..text">
115
+ <Data ss:Type="String">&lt;&gt;&amp;&#x27;&quot;&#x2F;</Data>
116
+ </Cell>
117
+ </Row>
118
+ <Row>
119
+ <Cell ss:StyleID="..currency_dollar_2_comma_black">
120
+ <Data ss:Type="Number">45.23</Data>
121
+ </Cell>
122
+ <Cell ss:StyleID="..number_none_0_nocomma_black">
123
+ <Data ss:Type="Number">1</Data>
124
+ </Cell>
125
+ <Cell ss:StyleID="..text">
126
+ <Data ss:Type="String">&lt;&gt;&amp;&#x27;&quot;&#x2F;</Data>
127
+ </Cell>
128
+ </Row>
129
+ <Row>
130
+ <Cell ss:StyleID="..currency_dollar_2_comma_black">
131
+ <Data ss:Type="Number">45.23</Data>
132
+ </Cell>
133
+ <Cell ss:StyleID="..number_none_0_nocomma_black">
134
+ <Data ss:Type="Number">1</Data>
135
+ </Cell>
136
+ <Cell ss:StyleID="..text">
137
+ <Data ss:Type="String">&lt;&gt;&amp;&#x27;&quot;&#x2F;</Data>
138
+ </Cell>
139
+ </Row>
140
+ </Table>
141
+ </Worksheet>
142
+ </Workbook>