Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: James Gray
RE: Move tc_speed.rb [ reply ]  
2006-02-27 21:18
I thought a lot about this before building the project.

The library is called *Faster*CSV and its first stated design goal is to be significantly faster than CSV, so I feel at least some obligation to prove it.

To do so, I parse a (scrambled) real-world data file with both libraries and assert that FasterCSV is at least three times as fast for the task. (The test is actually so slow because you are waiting on CSV most of the time!) It's actually closer to nine times faster currently, so that gives plenty of room for me to add new features. If those tests start to fail, I think it will be a helpful warning to me.

As an asside, those test verify that FasterCSV and CSV parse that data file identically, which seems to be important to users considering a switch.

I don't use Benchmark in these tests because I am not trying to impress people with numbers (there is a Rake task for that). Instead, I intend these tests to be a safety net for me durring development.

All that said, I do realize they are slow and I will see if I can't speed them up a bit.

Thanks for the feedback.

James Edward Gray II

By: Daniel Berger
Move tc_speed.rb [ reply ]  
2006-02-27 20:04
Hi James,

The tc_speed.rb test takes quite a bit of time on my lowly Sunblade 150. At first, I thought I had hit a loop bug of some sort.

May I suggest you create a 'benchmark' folder under the toplevel directory, move this file there (giving it a new name) and use the Benchmark module to do a speed comparison?

I just don't think a benchmark belongs in the test suite.

Regards,

Dan