Skip to content

Commit

Permalink
Added new test to table benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdowad committed Aug 19, 2012
1 parent 4113335 commit 0ab9b91
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions bench/table_bench.rb
Expand Up @@ -33,16 +33,15 @@ def benchmark_table_generation(columns,rows,string_size,options={})
end end
end end


# Slowest case: styled table, which is very squeezed horizontally,
# so text has to be wrapped
benchmark_table_generation(26,50,10, :row_colors => ['FFFFFF','F0F0FF'], :header => true, :cell_style => {:inline_format=>true})

# Try building and rendering tables of different sizes # Try building and rendering tables of different sizes
benchmark_table_generation(10,450,5) benchmark_table_generation(10,400,5)
benchmark_table_generation(10,300,5)
benchmark_table_generation(10,200,5) benchmark_table_generation(10,200,5)
benchmark_table_generation(10,100,5) benchmark_table_generation(10,100,5)


# Try different optional arguments to Prawn::Document#table # Try different optional arguments to Prawn::Document#table
benchmark_table_generation(10,450,5, :cell_style => {:inline_format=>true}) benchmark_table_generation(10,450,5, :cell_style => {:inline_format=>true})
benchmark_table_generation(10,450,5, :row_colors => ['FFFFFF','F0F0FF'], :header => true, :cell_style => {:inline_format=>true}) benchmark_table_generation(10,450,5, :row_colors => ['FFFFFF','F0F0FF'], :header => true, :cell_style => {:inline_format=>true})

# Try different "aspect ratios", with same total number of cells
benchmark_table_generation(20,100,5)
benchmark_table_generation(25,80,5)

0 comments on commit 0ab9b91

Please sign in to comment.