On 26 Apr 2010, at 10:36, Dermot wrote:
Obviously I'd rather use the faster method but if I'm breaking the
encapsulation in some ways that's going to bite me later, I'd steer
clear.
Premature optimisation is the root of all evil.
I really really wouldn't be worrying about method call overhead vs
direct hash access until:
1) Your confident your code is using the correct algorithms (i.e. you
can bogosort a lot faster with direct access than methods - that
doesn't meant you're not still doing a bogosort!)
2) Optimising things that profile as slow in YOUR APPLICATION.
The speedup (in developer time) you get from using the highest level
interface / abstraction appropriate ALWAYS buys you enough extra time
to have a round of optimisation once your code works, and fixing the
_actual_ pain points is likely to give you many more gains than
writing your code you in a way you think (due to trivial synthetic
benchmarks) will be faster, but that takes longer.
It should be noted that Catalyst _SPED UP_ (on perl 5.10) when it was
ported to Moose.
Cheers
t0m
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/