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.
| Comment | File | Size | Author |
|---|---|---|---|
| pathauto_cleanstring_cache.diff | 7.14 KB | dalin |
Comments
Comment #1
gregglesThis 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.
Comment #2
dave reidI think static caching cleanstring() makes a lot of sense. Also see #834198: Improve performance of pathauto_cleanstring() and pathauto_get_placeholders().
Comment #3
dave reidComment #4
dave reidMerging this request into #834198: Improve performance of pathauto_cleanstring() and pathauto_get_placeholders().