Check in apachesolr_do_query if the static of the query with that name already exists, and if so return it.
This is needed if a query needs to be run twice on the same page load, this way we are optimizing the process.

Comments

milesw’s picture

pwolanin’s picture

Category: task » bug

sounds more like a bug?

nick_vh’s picture

is this an RC blocker? Don't think so

nick_vh’s picture

Status: Needs review » Active
StatusFileSize
new38.11 KB
new38.15 KB
new7.44 KB

So, this patch does exactly that.

The smallest one is the improved one, so this does help performance wise, whenever you are running the same query twice on the same page. Logically, this does not change anything if you are not executing a query twice on the same page.

XHProf view | Smartphone compare-1.jpg
XHProf view | Smartphone compare.jpg

nick_vh’s picture

StatusFileSize
new633 bytes

wrong patch file, apologies

nick_vh’s picture

Status: Active » Needs review
nick_vh’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Status: Active » Patch (to be ported)

needs backport, committed to 7.x-1.x

killua99’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new633 bytes

Ported, I test it with the apachesolr search module.

pwolanin’s picture

Should this check happen earlier - before the drupal_alter?

nick_vh’s picture

Version: 6.x-3.x-dev » 7.x-1.x-dev
StatusFileSize
new889 bytes

Since the query alter wouldn't do anything useful before returning the cached results, I agree here.

Patch is for 7.x-1.x

nick_vh’s picture

Status: Needs review » Fixed

Committed to 7.x-1.x and 6.x-3.x

nick_vh’s picture

Status: Fixed » Closed (fixed)
nick_vh’s picture

Issue summary: View changes

Updated issue summary.