in reply to Re^5: POE OO sessions - accessing overwritten methods
in thread POE OO sessions - accessing overwritten methods
Interesting. But they are quite wrong (see above).
Actually, you're quite wrong. And if you learnt to use strict you'd have seen your mistake.
Here are the results of your benchmark once your mistake is corrected.
[18:46:32.42] P:\test>junk Rate Ref_Named Named Ref_Copy Shift POE + Normal Ref_Named 119185/s -- -3% -35% -81% -83% + -84% Named 122333/s 3% -- -34% -81% -83% + -84% Ref_Copy 183991/s 54% 50% -- -71% -74% + -76% Shift 639848/s 437% 423% 248% -- -9% + -17% POE 701269/s 488% 473% 281% 10% -- + -9% Normal 768699/s 545% 528% 318% 20% 10% + --
And that should absolutely zero surprise to anyone: OBJECT, KERNEL, HEAP, and SESSION are all subs which would mean subroutine calls.
You're the one in for the surprise. They aren't subroutine calls, they are constant subroutine calls. What difference does that make?
It means that at compile time, Perl can detect that they are constant subroutines.
[18:43:58.10] P:\test>perl -MO=Deparse -e"use constant{ONE=>1,TWO=>2}; + for( ONE .. TWO) { print }" use constant ({'ONE', 1, 'TWO', 2}); foreach $_ (1 .. 2) { print $_; } -e syntax OK
Did you spot your error yet? use strict would have told you way back up ^ there somewhere--but I guess that is another "artificial box" you'd rather stay out of.
So, what do you think we should put a pox on now? Flying by the seat of your pants! :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: POE OO sessions - accessing overwritten methods
by Tanktalus (Canon) on Feb 12, 2005 at 19:23 UTC |