Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Accessors in xs

by tilly (Archbishop)
on Oct 25, 2005 at 00:38 UTC ( [id://502608]=note: print w/replies, xml ) Need Help??


in reply to Accessors in xs

After converting to XS, check your performance gains.

If they don't satisfy you, you might get another gain from converting some method calls to function calls since method lookups are significantly slower.

Replies are listed 'Best First'.
Re^2: Accessors in xs
by hardburn (Abbot) on Oct 25, 2005 at 03:31 UTC

    Yes, I've been thinking about that. I have a few more I want to convert first. I don't like going down to function calls if the rest of the program is OO, but I might not have a choice.

    "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

      If you think your overhead is in method calls, check to see that you're not doing anything which invalidates the method cache:

      • Assigning type globs
      • Assigning functions into the symbol table
      • Creating or removing named functions
      • Modifying @ISA

      Since you're using XS already, you may want to write a short function to instrument PL_sub_generation to see if its changing. Anytime it increments, your cache is invalidated.


      New as of 5.9.4, this function is B::sub_generation

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://502608]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found