Not sure if anyone cares about D5 anymore. But I was doing some PHP profiling and I discovered a few opportunities for improvement with the pathauto module. For all I know these have long been fixed so take-it-or-leave-it:

- pathauto_cleanstring is very expensive and called hundreds of times on a node save (at least on the behemoth of a site that I'm currently working on). But it is often called with the same parameters. A few static variables go a long way here.

- The transliteration is very expensive. Swapping out the ini file method for iconv() gives a big improvement.

CommentFileSizeAuthor
pathauto_cleanstring_cache.diff7.14 KBdalin

Comments

greggles’s picture

Version: 5.x-2.x-dev » 7.x-1.x-dev

This changes some functionality (iconv) so it's not likely to be acceptable for 5.x.

If we remove the iconv then the static caching seems like a solid idea that we should embrace for as many branches as people want to work on patches. I wonder if this is still true for 7.x given the way tokens are built there or if it only affects 6.x and below.

dave reid’s picture

I think static caching cleanstring() makes a lot of sense. Also see #834198: Improve performance of pathauto_cleanstring() and pathauto_get_placeholders().

dave reid’s picture

Status: Active » Needs work
dave reid’s picture

Status: Needs work » Closed (duplicate)