This post originated from an RSS feed registered with Ruby Buzz
by Daniel Berger.
Original Post: Pathname2, an ode to speed
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
A short while back, the slightly wacky Trans mentioned that Pathname was rather slow at certain operations. While I normally don't care about speed, I decided to bench my own version of Pathname just to see how it faired.
It kinda sucked, really.
Not a big deal, though. I mean, seriously, how often are you calling Pathname#descend anyway? Probably not much, so it shouldn't make any difference. Functionality is the key here, right?
Yes, but that won't stop me from doing something crazy like making a C version of the pathname2 package. In fact, it's mostly done. Actually, it's been a rather positive experience. I've discovered a few minor bugs in the pure Ruby version along the way, mostly on Windows, and added a bunch more tests as a result. I've also added destructive and non-destructive versions of a few methods and added a tweak here and there.
The biggest pain is the manual delegation I have to do for some of the classes.