I have come to know about Devel::NYFTProf but not quite able to understand how to use it. The gui has a launching script which in turn calls some more scripts using some modules.
What do you not understand about how to use it?
You probably don't need to profile the gui itself, so how are you "calling" the other scripts from it?
Use faster accessors
The fastest accessor is the one you don't call.
It may go against OO-dogma; but in 95% of cases, there is no good reason to use subroutines to access instance variables from within that class's methods.
There are three main reasons formally cited for using accessors within a class's methods:
- To isolate the rest of that implementation from future substantial changes to the structure and/or layout of the instance data.
This could only ever become a saving if that data layout changed beyond recognition; and if that happens, the likelihood that you would get away with not also substantially rewriting method code is almost nil.
- To provide centralised, single point validation of values assigned to instance variables.
If your class is even vaguely well designed and written; it should not be possible for internally sourced assignments to instance variables to assign invalid values. Thus, re-validating those internally-sourced values for every assignment is pure overhead.
- People often respond to that with: "But what about values that come into a class from outside"?
And the answer is that external inputs should be validated at the point of transition across the class boundary. Ie. Whenever an externally visible method is called; you should validate its parameters. But external code should never be directly accessing instance data, therefore there should be no such thing as externally visible accessors.
In short. External code calls methods to perform services, not access internal data. Where service methods accept arguments; those arguments must be validated immediately; and once so validated; any values derived from those arguments that subsequently gets set into instance variables require no further validation.
Thus, method code can safely directly access instance variables. Which in turn avoids both the overhead of accessor method calls; and centralised re-validation.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||