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.
(read on for comparison of the top 15 subs)
Profile of test.pl for 5246s, executing 533397042 statements and 183082682 subroutine calls in 342 source files and 80491 string evals.
Profile of test.pl for 3466s, executing 328628699 statements and 133802224 subroutine calls in 345 source files and 80406 string evals.