in reply to Re: Error handling in chained method calls
in thread Error handling in chained method calls
Not necessarily.
If the methods are immutable and follow the "cascading convention" to always return $self it should be possible to be much faster by memoizing name and reference of allowed methods in a hash.
The trick would be to use the $obj->$methref() syntax, compare
Re: Error handling in chained method calls
IIRC normal method calls are ten times slower than a function call.
So if performance matters this could be a legitimate way to boost "alien" classes one isn't allowed to change.
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Error handling in chained method calls
by BrowserUk (Patriarch) on Oct 24, 2010 at 11:06 UTC | |
by LanX (Saint) on Oct 24, 2010 at 18:38 UTC | |
by Corion (Patriarch) on Oct 24, 2010 at 19:00 UTC | |
by BrowserUk (Patriarch) on Oct 24, 2010 at 18:58 UTC | |
by LanX (Saint) on Oct 24, 2010 at 21:08 UTC | |
by BrowserUk (Patriarch) on Oct 25, 2010 at 03:08 UTC | |
|