"We call a LOT of methods in our system, if we can make calling them faster, it would make a difference."

There is a TODO item in the perltodo about a potential speed-up of the entersub op which needs to be evaluated on every sub call:

entersub-XS-vs-Perl

I had a brief look at it and while I'm not exactly a core hacker, that task seems rather difficult. It's also no fun, so you most likely won't find somebody to do it in his or her spare time. My gut feeling is that you'd have to either try to do that within your organization or try to find a perl core hacker willing to tackle the issue and pay him for it.

A cheaper but certainly tiny optimization might be to replace accessor methods a la sub get_foo { $_[0]->{foo} } with use Class::XS getters => [qw(foo)];. (Same thing for setters, of course.) Unfortunately, that won't fly if you want to do any checking in your accessor methods. Then, you could "steal" the corresponding XS from the aforementioned module and use it as a template to roll your own.

Cheers,
Steffen


In reply to Re: Optimizing a large project. by tsee
in thread Optimizing a large project. by dextius

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.