zdavatz/spreadsheet — pull request #5 by minaguib (2012-06-11 21:37:00+00:00)
Title: Speed up writing

As discussed via email, I'd like to submit these patches for inclusion upstream.

They greatly reduce the time it takes to write workbooks, especially ones with a large number of cells.

In my test script, measuring the previously released stable version of the gem:

$ ./make_book.rb
Mon Jun 11 12:16:12 -0400 2012 Populating
Mon Jun 11 12:16:13 -0400 2012 Populated 25056 rows
Mon Jun 11 12:16:13 -0400 2012 Writing
Mon Jun 11 12:21:55 -0400 2012 Done
Mon Jun 11 12:21:55 -0400 2012 writing done in 341.704384088516 seconds

After my changes:

$ ./make_book.rb
Mon Jun 11 12:22:02 -0400 2012 Populating
Mon Jun 11 12:22:03 -0400 2012 Populated 25056 rows
Mon Jun 11 12:22:03 -0400 2012 Writing
Mon Jun 11 12:22:16 -0400 2012 Done
Mon Jun 11 12:22:16 -0400 2012 writing done in 13.5842142105103 seconds