[Catalyst] Performance

Carl Franks fireartist at gmail.com
Fri Mar 9 07:52:56 GMT 2007


On 09/03/07, Nilson Santos Figueiredo Junior <acid06 at gmail.com> wrote:
> On 3/8/07, Jim Spath <jspath at pangeamedia.com> wrote:
> > URI is next up at around 14% of time.  Is there anything that can be
> > done about this one?
>
> Wherever is reasonably possible, instead of actually using calls to
> $c->uri_for() for every item, call it only once and then build the
> rest of the URI manually.
>
> By making this kind of changes throughout an entire Catalyst
> application I've been able to get 15-20% better performance.

This has been really bugging me, but I haven't had the time to look
into it further.

A URI object is a blessed string.
A blessed uri-escaped string!
So any method that changes a uri, or extracts info from it must be
having to parse the string each time. And I'm sure there must be a lot
unescaping/escaping going on.

The only thing that's optimised for is printing!
I'm sure it the uri components were kept in a blessed hash, and not
combined and escaped until necessary, it would make a difference.

Does anyone have the spare time to consider refactoring URI?
Please?

Carl



More information about the Catalyst mailing list