April 2010 Archives

The people that make the perl community great

Today, I ventured into #dbix-class inquiring about some performance problems I was having. I wasn’t complaining about the speed of DBIC, I was looking for ways to trim out work that I was doing that I could avoid doing. The script I was running (file parser + insert into DB) was taking a little more than an hour to run. I was musing whether to drop DBIC, parallelize the job or just deal with the slowness when* ribasushi* (Peter Rabbitson) came to the rescue. After sharing with him a copy of NYTProf’s output, he quickly identified some hot-spots in SQL::Abstract that could be worked on. Soon enough, Caelum (Rafael Kitover) chipped in and we had improvements (some XS code wasn’t being used) in Class::Accessor::Grouped coming. Within an hour I was upgrading CAG, SQLA, DBIC and installing Class::XSAccessors and profiling the code again.

Total improvement: time spent inside CAG dropped by 57% and 44% in SQLA Total time elapsed: ~2 hours.

If this is not a sign of what makes the perl community great, I don’t know what is.

The code is not flying any any means, but the total runtime was reduced by 34%, which is not bad for an evening’s work.

SQL::Abstract Changes DBIx::Class Changes

(read on for comparison of the top 15 subs)

About Guillermo Roditi

user-pic I blog about Perl.