I noticed this while reviewing the latest patch for #231640: Auto-generate some release nodes:
Neither _drupalorg_testing_get_tid_by_term() nor taxonomy_get_term_by_name() cache their results.
_drupalorg_testing_get_tid_by_term() is called in a nested foreach loop when generating release nodes, and therefore, we're doing A LOT of duplicate queries.
Yes, it's an install profile, so we don't really care about performance that much, but we don't need to ruthlessly pound the DB for nothing. ;) Think of the kittens on shared hosting test sites that might get in trouble with bogus queries/second quotas and the like...
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 320150_dot_cache_tids.patch | 1.24 KB | aclight |
Comments
Comment #1
aclight commentedOk, here we go. By my count, this saves 318 db queries over multiple seconds. Probably not that big of a deal, but maybe in the future when this profile has 1000 projects in it the savings will become significant. :)
Comment #2
dwwPerfect, thanks.
Comment #3
aclight commentedCommitted to HEAD
http://drupal.org/cvs?commit=145978
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.