I'm probably going to need to use the PathAuto module for a current project. While using it in development, as admin, the site slowdown during changes is insane.
Is PathAuto a big memory sink, and are there ways to mitigate this?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI'm probably going to need to use the PathAuto module for a current project. While using it in development, as admin, the site slowdown during changes is insane.
Is PathAuto a big memory sink, and are there ways to mitigate this?
It depends greatly on which version of Core you are using. The main memory issue is with Token module for Drupal 6, when given a node will generate all possible tokens for that node, regardless of the tokens that will actually be replaced. This means that expensive tokens that need to load or render other objects, etc, in addition with the sheer amount of tokens generated causes the issues.
With Drupal 7, the improved token API only generates tokens that you actually use and greatly improves performance and memory usage. In normal use, Pathauto really only matters when an item is being saved but does not affect "normal" page views.
One issue that we stumbled upon in Drupal 7 is when you have a many nodes which would get the same path alias. Because what then happens is that the first one gets $alias, the second one tries $alias, sees that this one is already reserved and uses $alias-1. The third one tries $alias, then $alias-1 and then uses $alias-2. And so on. That's not pathauto's problem, though and it's not really a bug as you should either clean up your crappy data (we had 600k imported print articles with hundreds of equal titles.. like "weather" ;)) or choose a better pattern for your alias (e.g, include the date). This can also seriously slow down a data import if you have pathauto enabled.
Another issue is that the token browser explodes if you have many fields which can completely break any page that lists a token browser, especially the pathauto config site which has multiple of those.
Apart from those related issues, I haven't seen any direct performance issues caused by Pathauto. If you think you do, what you really should do is profile your site with Xhprof to see what's actually using the cpu/memory.