Problem

We have a rather large request, loading up to 10k results. When extracting the results 40% of the time is spent getting the same target index id over and over again.

Solution

Cache the result of the getTargetedIndexId() function in SearchApiSolrBackend
I'm not sure how its best cached, if the maintainer could give a hint. I would be glad to provide a patch.

Comments

Siegrist created an issue. See original summary.

mkalkbrenner’s picture

Status: Active » Needs review
StatusFileSize
new1.37 KB

Try this patch.

siegrist’s picture

Works for me thanks :)

mkalkbrenner’s picture

Status: Needs review » Needs work

The patch is a workaround. The issue was introduced by the Highlighter re-implementation.
In general we should avoid static caches like in the current patch as they might cause issues, for example in batch processes.
I'm working on a "fix" for the Highlighting to avoid this calls.

  • mkalkbrenner committed 0dcb599 on 4.x
    Issue #3160826 by mkalkbrenner, Siegrist: Performance issue in...
  • mkalkbrenner committed 4b56dc1 on 4.x
    Issue #3160826 by mkalkbrenner, Siegrist: Performance issue in...
mkalkbrenner’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.