Drupal, Start Here
Whether you’re just starting your first website or you want to do a major web-based project, Drupal is a the way to bring your ideas to life and Drupal, Start Here will help you start quickly.
It is always a good things when a site grows large enough to worry about performance issues. With more users and longer reports, one site I regularly work on was having an issue building a reservation report page. Quickly I turned on Devel with its query log, checked the main query that builds the report, put it through EXPLAIN and optimized a few keys. But no real improvement was made. So I looked again at the query log, and noticed that drupal_lookup_path() was being called 1000 times (as many results in the report, and yes the Project manager wants them all on one page). So I am making 1000+ individual queries to the url_alias table, each taking only a few ms, but added together it is slowing down the report. This is what the offending line looks like: ... = l($reservation_id, 'reservation/info/'. $reservation_id); I finally realized that I don't need aliasing on those links. They simply link to the information page of a particular reservation (reservation/info/34038) which will never, and should never be aliased. Now my code looks like: ... = l($reservation_id, 'reservation/info/'. $reservation_id, array('alias' => TRUE)); A months worth of data now renders in seconds, instead of over a minute. A rule of thumb I am thinking of using is a Task Oriented versus Content Oriented links mentality. If a link is solely for transitory or task based activity (like creating or editing a comment) then it shouldn't even try to be aliased. A perfect example are all the edit links on the node and comment administration pages. Is anyone in their right mind going to create an alias for 'node/45/edit' or for 'comment/edit/1822'. I am not saying you should turn off path aliasing everywhere, but for any page littered with task oriented links in the hundreds, it might really speed up your day to do so. |
|||






interesting fix. I would have
interesting fix. I would have first though of putting the alias table in a memcached bin.. an inferior idea but it might have worked :)
There is a discussion on how
There is a discussion on how to improve drupal_lookup_path() at http://drupal.org/node/106559
Great article. However,
Great article. However, there are many cases where people want to alias 'node/45/edit' - I get requests for it in the Pathauto queue all the time.
Hmm, I can see the point of
Hmm, I can see the point of http://drupal.org/node/203804. But those aliases would be for forward facing pages. The node admin page still wouldn't need to use the aliases for the 50 node/*/edit links.
I don't want to say such aliases can never be needed, but in some instances they could be ignored, like the content admin pages.
@peach, but that assumes that all sites have memcache bins. This approach is technology independent, as I was looking more for a principle for varying implementations.
Very nice tip. Thanks.
Very nice tip. Thanks.
Whitelist approach ... If you
Whitelist approach ...
If you go to #106559-171, there is a patch to path.inc for D6 and D7 that would eliminate alias lookups for paths that do not exist.
What it does is build a whitelist based on the top level path components (the part before the first / in "foo/bar"). That white list is then consulted before each lookup, and if the path that is being looked up does not exist in the whitelist, then no alias query is done.
So, as long as you have no aliases in the database starting with "reservation/", that patch takes care of your situation without having to code it in the theme and modules everywhere you use l().
Hope this patch gets accepted.
Godd an your comment
Godd an your comment
Good an your my Lida - Biber
Good an your my Lida - Biber hapı
In today’s competitive
In today’s competitive business scenario, an effective and user friendly website design is critical for achieving business success.
for example, i will search Indonesia Java International Destination
i think design analyzer for SEO friendly is very important..
I have already started
I have already started reading some of your articles. i found great articles here. And I will get back here. I just added your blog to my bookmark sites. thanks.
blog walking in here :sms
blog walking in here :sms lucu
hai....freinds..read a nice
hai....freinds..read a nice article . from me : resep brownies kukus
i like to visit your blog..a
i like to visit your blog..a nice article. From me : Cerita lucu
Good morning...keep posting
Good morning...keep posting contoh judul skripsi
I have found so many
I have found so many interesting thing in your blog and I really love that. Keep up the good work.Really interesting articles.I enjoyed reading it. I need to read more on this topic.
Wholesale Foods
good reading indonesia java
good reading indonesia java international destination
a Very nice post , a nice
a Very nice post , a nice post indeed , you have share a nice fix which will help me a lot thanks for your awesome work , i will bookmark this site right away. Online Nursing Programs
This is infect much more
This is infect much more concise and good post really appreciated. digital printing