P is for Practical | |
PerlMonks |
Profiling woesby goupilInside (Sexton) |
on Apr 09, 2008 at 11:05 UTC ( [id://679203]=perlquestion: print w/replies, xml ) | Need Help?? |
goupilInside has asked for the wisdom of the Perl Monks concerning the following question: Hello fellow Monks. I have encountered a tiny annoyance that has me seeking your knowledge. I have a script, a CGI, using Class::DBI running far too slow that I must "cure". The platform is Linux and Perl version is 5.8.8. "Yipee" I thought, "I will be using those crazy profiling facilities Perls offer".
And so I proceeded.
Alas, poor me, the program starts but then produces a tense and pretty insulting "segmentation fault" -- then dies.
The resulting tmon.out seems truncated and only contains information regarding environment startup.
Being still joyful and naive, I moved to Devel::Profiler, the CPAN having warned me of the possible deprecation of the old DProf ways.
"Well", said I, "why not trying Devel::SmallProf". Devel::FastProf produced a 4K fastprof.out file containing nothing useful (with or without withfork option) DBI::Profile is working well and indicating that the DB aspects are mostly correct, so I'd really like to be able to profile the sneaks of client side code. Beside being stuck on the head until Satori, I seem to have tried every reasonable way. Is there some wise voice in here who would show an humble disciple the way of illumination ? UPDATE: It turns out to be quite stupid and fully due to my script. I have some module called lib/TheProject/DB.pm containing mostly the connection management and some small tools common to all DB oriented classes. Then all Dabases classes are in modules like lib/TheProject/DB/SomeDBBackedClasses.pm, which requires using TheProject::DB. Except that one of the developpers (it can't be me, can it ? ...cof, cof), has typed use DB; instead of use TheProject::DB;, including the Debugging related libraries causing a mess of respectable proportions (it still worked because below he/she/it added a use TheProject::DB. Removing the guilty use makes all the profilers happy. Thanks to all who answered and gave me directions. /me is going to check in the SVN whom to apply the clue stick to.
Back to
Seekers of Perl Wisdom
|
|