thirtyseven/dullard — pull request #4 by chewi (2013-07-17 17:22:27+00:00)
Title: Speed boost and row count from metadata

I want to have a progress bar when reading a large file so I needed to know the number of rows in advance. Luckily there is metadata for this. If this tag is missing or at the very bottom of the file for some reason, it takes about 30 seconds to try and look for it on my machine with a 55MB file. This is quite long but not stupidly long and I imagine the tag would always be near the top of any properly written file.

While looking at this, I thought the code would look cleaner and possibly even run faster with case statements. I was expecting around a 2% boost if anything so I was a little surprised when I got an 8% boost on the above file.