# Writing a large file with Spreadsheet: very slow, any HELP?

**URL:** <https://www.ruby-forum.com/t/writing-a-large-file-with-spreadsheet-very-slow-any-help/185251>\
**Category:** Rails\
**Created:** [March 16, 2010, 9:30pm UTC](https://www.ruby-forum.com/t/writing-a-large-file-with-spreadsheet-very-slow-any-help/185251 "2010-03-16T21:30:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![joep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@joep](https://www.ruby-forum.com/u/joep)\
**Post date:** [March 16, 2010, 9:30pm UTC](https://www.ruby-forum.com/t/writing-a-large-file-with-spreadsheet-very-slow-any-help/185251/1 "2010-03-16T21:30:07Z")

</div>

Hey,

I’m using the Spreadsheet gem to generate Excel files. It’s worked  
great up until now.

I’m trying to put 25,000 rows in a sheet, then doing book.write to write  
the file. It’s really slow, like 3-4 minutes.

Is there a way to write groups of rows to a sheet at a time, or some  
other way to speed up this process? Thanks in advance for any advice.

---

<div class="post-metadata">

**Author:** ![joep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@joep](https://www.ruby-forum.com/u/joep)\
**Post date:** [March 17, 2010, 1:54pm UTC](https://www.ruby-forum.com/t/writing-a-large-file-with-spreadsheet-very-slow-any-help/185251/2 "2010-03-17T13:54:34Z")

</div>

Joe P. wrote:

> Hey,
> 
> I’m using the Spreadsheet gem to generate Excel files. It’s worked  
> great up until now.
> 
> I’m trying to put 25,000 rows in a sheet, then doing book.write to write  
> the file. It’s really slow, like 3-4 minutes.
> 
> Is there a way to write groups of rows to a sheet at a time, or some  
> other way to speed up this process? Thanks in advance for any advice.

Oh yeah, I’m using the latest Spreadsheet gem, 0.6.4.1 if that makes a  
difference. Any thoughts on how to speed up the writing process?

---

<div class="post-metadata">

**Author:** ![joep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@joep](https://www.ruby-forum.com/u/joep)\
**Post date:** [March 17, 2010, 4:32pm UTC](https://www.ruby-forum.com/t/writing-a-large-file-with-spreadsheet-very-slow-any-help/185251/3 "2010-03-17T16:32:40Z")

</div>

I hope you’re sending those tasks to a background worker…

---

<div class="post-metadata">

**Author:** ![joep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/87869e/32.png) [@joep](https://www.ruby-forum.com/u/joep)\
**Post date:** [March 17, 2010, 4:35pm UTC](https://www.ruby-forum.com/t/writing-a-large-file-with-spreadsheet-very-slow-any-help/185251/4 "2010-03-17T16:35:38Z")

</div>

David C. wrote:

> I hope you’re sending those tasks to a background worker…

Not yet, but that’s probably the route I’ll be going.
