Once again I return for help. the last two times, you guys have saved me after DAYS of hair-pulling, with simple answers that I've overlooked. Thanks in advance. :)
So, this is the 'perl -d:DProf testfile.cgi' then 'ddprofpp -r -I' of a small perl function that is updating a character's stats in a homebrew online game. It loads their info, outputs it to screen, updates their whatever, and closes.
My problem: Note the huge amount of time taken in 'Main:Begin'. What does that mean? Does that mean that the majority of this code is burning its time in the actual main function, and not in all of the calls - i.e. there is probably inefficient formatting / loops in there? Or should that be disregarded, and the other parts of the output looked at? (note, these were run during unusually high load times, excuse the length of execution.
%Time ExclSec CumulS #Calls sec/call Csec/c Name
39.6 0.251 0.304 14 0.0179 0.0217 main::BEGIN
5.35 0.000 0.041 1 0.0001 0.0413 main::SETUP_GAME
4.05 0.000 0.031 1 0.0000 0.0307 DBI::connect
3.92 0.000 0.030 4 0.0000 0.0076 DynaLoader::bootstrap
2.74 0.010 0.021 12 0.0009 0.0017 DBI::BEGIN
2.74 0.000 0.021 1 0.0001 0.0206 DBI::install_driver
2.61 0.000 0.020 9 0.0000 0.0022 main::CHANGE_PLAYER_VALUE
2.61 0.020 0.020 15 0.0013 0.0013 DBI::db::do
2.61 0.020 0.020 1 0.0200 0.0200 Image::Magick::bootstrap
1.70 0.002 0.013 83 0.0000 0.0002 DBI::st::fetchrow_hashref
1.44 0.010 0.011 1 0.0102 0.0111 main::LOAD_PLAYER_STATS
1.44 0.000 0.011 6 0.0001 0.0018 main::GET_FLAG
1.44 0.011 0.011 83 0.0001 0.0001 DBI::st::FETCH
1.31 0.010 0.010 6 0.0017 0.0017 File::Copy::BEGIN
1.31 0.010 0.010 36 0.0003 0.0003 DBI::st::execute
Second 'bonus' question: This output is on the same file but while using SelfLoader. does it sa to you 'wow, selfloader is a bad idea for this guy, he should use autoLoader' or 'he should not be using either'?
%Time ExclSec CumulS #Calls sec/call Csec/c Name
31.0 0.130 0.669 7 0.0185 0.0955 main::BEGIN
30.5 0.059 0.658 36 0.0016 0.0183 SelfLoader::AUTOLOAD
25.9 - 0.560 1 - 0.5598 DBI::connect
25.5 0.550 0.550 1 0.5500 0.5500 DBD::mysql::db::_login
25.5 - 0.550 1 - 0.5500 DBD::mysql::dr::connect
25.5 - 0.550 1 - 0.5500 DBI::dr::connect
25.5 - 0.550 1 - 0.5500 DBI::__ANON__
22.7 - 0.490 4 - 0.1225 DynaLoader::bootstrap
19.5 0.010 0.420 12 0.0008 0.0350 DBI::BEGIN
18.5 0.400 0.400 1 0.4000 0.4000 DBI::bootstrap
17.1 0.370 0.370 36 0.0103 0.0103 DBI::st::execute
3.71 0.080 0.080 1 0.0800 0.0800 Image::Magick::bootstrap
3.25 0.070 0.070 16 0.0044 0.0044 DBI::db::do
1.39 0.030 0.030 9 0.0033 0.0033 SelfLoader::BEGIN
0.93 - 0.020 1 - 0.0196 main::LOAD_MISSION
Triple bonus: What's with the Image Magick bootstrap? I don't call IM in any of these files in any way.
I hope this is understandable, I sometimes have a hard time getting things across concisely in English.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.