Loading...
 
Skip to main content

Development


You are viewing a reply to Very effective performance fix

Re: Very effective performance fix

Well, I got some time to wrap my noodle on this function when I got home from work, and I have a proposed patch now (a diff is hereQuestion). This reduces the overall time spent in parse_pp_np() from 49% to 2%. This has almost cut my page load time in half.

I'm making the assumption that these ~np~ tags aren't nested here, and I can't say I have tested this very thoroughly 😊. But it gives a better idea how we can improve performance here by avoiding expensive calls. Btw, this eliminated about 37,000 calls to substr() when viewing my page.

There's still room for more improvement, but this was easily the biggest and easiest win to start with. I'm somewhat surprised that we're now spending about 13% of the time calling basename(), it seems to be a pretty expensive call, and it's the next biggest consumer.

Cheers,

-- Leif