[plug] Perl OO/Data Optimisation

Trevor Phillips T.Phillips at murdoch.edu.au
Wed Nov 27 12:08:37 WST 2002


Any Perl Guts Gurus here? ^_^

I have an OO app which does nasty things to a large multi-depth hash of data 
(of which some of it is structures of objects), and I'd really like to 
optimise it, but I'd rather not spend time doing optimisations that Perl may 
do internally.

So, in general: Is it worth me compiling my hash into arrays with integer 
references? ie; Instead of $data->{prop}, convert it to $data->[num], and 
things that reference prop to reference it as num?

Is it worth dumping the object structure (HTML::Element), and using a 
simplified hash or array structure, and walking it manually?

If I reference a hash several times in a row, is it faster to assign it to a 
temporary variable, or does Perl cache/optimise that internally?

When building text by shuffling chunks of text around, is there a more 
efficient way than appending the text as you go, and storing the chunks in a 
hash?

Any other hints on how I can get performance increases by the way data is 
handled?

-- 
. Trevor Phillips             -           http://jurai.murdoch.edu.au/ . 
: Web Technical Administrator     -          T.Phillips at murdoch.edu.au : 
| IT Services                        -              Murdoch University | 
 >--------------------------------------------------------------------<
| On nights such as this, evil deeds are done. And good deeds, of     /
| course. But mostly evil, on the whole.                             /
 \      -- (Terry Pratchett, Wyrd Sisters)                          /



More information about the plug mailing list