The performance of purl_modifiers() can be significantly improved, in particular for implementations where providers set null_id = TRUE and the {purl} table contains a large number of values.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | purl-improve_purl_modifiers_performance-1595076-5.patch | 3.66 KB | dbehrman |
| #3 | purl-improve_purl_modifiers_performance-1595076-3.patch | 3.66 KB | pdrake |
| #1 | purl-improve_purl_modifiers_performance-1595076-1.patch | 3.79 KB | pdrake |
Comments
Comment #1
pdrake commentedIn my particular use-case (large number of values in the {purl} table, one provider with null_id = TRUE), the attached patch improves performance by somewhere between 0.5s and 3.0s depending on the page.
Comment #2
pdrake commentedComment #3
pdrake commentedThis patch applies to the latest stable release (6.x-1.0-beta13) for anyone who may be using that version but can otherwise be ignored. The patch for 6.x-1.x-dev is #1.
Comment #4
glennpratt commentedDiff looks good and is running fine in production on a site using purl_prefix and spaces_og.
Comment #5
dbehrman commentedUpdated patch:
$result = db_query("SELECT id, value FROM {purl} WHERE provider = %s", $provider);
should be
$result = db_query('SELECT id, value FROM {purl} WHERE provider = "%s"', $provider);