Some neat libraries that have happened recently; not by me.
I found CSVScan on the RAA only a few days after I wrote my own fast CSV parser. CSVScan itself had been released only a few days before. It’s Ragel-based, and implements the most common CSV “spec”, unlike my Ccsv, which only supports a constrained format.
Ccsv is faster, but not enough to care about. Here’s a benchmark yielding 1,000,000 rows from a file:
I’m surprised it took until Sep 2007 for someone to write a C CSV parser.
Ccsv development is halted; if I had known about CSVScan, I wouldn’t have written it. It would be nice, though, if CSVScan had a
foreach method and a gem version.
If you’re learning, Ccsv still makes an excellent example of a plain C extension. CSVScan makes an excellent example of a Ragel extension.
Ara wrote a leak detector called Dike, which bears investigation. Using the object finalizer is a good idea. Probably the ideal leak detector will be lifecycle-based (sort of like Dike) instead of snapshot-based (like BleakHouse), but C-implemented (like BleakHouse) so that we can guarantee we aren’t introducing leaks in the attempt to track them, and so that it’s fast enough to use in live production environments.
If we do lifecycle tracking we should be able to identify the exact line of app code that spawns the leaks.
I was at the Ruby East conference today. It was good. Mike Mangino gave an excellent talk on mocking. Also, I met Gregory Brown in real life. Good guy; hair longer than mine.
Despite Mike’s talk, I’ve added an integration suite to Ultrasphinx. No mocks here. I actually removed some of the unit tests; for a local service consumer like Ultrasphinx, the integration suite is definitely the way to go.
Now I can approach full coverage in the plugin itself instead of relying on CHOW as the integration test—that was definitely not optimal. Also I can spawn mongrels in
setup and kill them in
teardown, which lets me test awkward situations like development environment class reloading.
Mark Lane contributed the sample app, so it’s still NIH even though I wrote the helper and initial tests. Good times.
Too bad we didn’t get some more time to chat, but it was good to meet you.
Going to be at RubyConf?
Yep, I will be there.