When the facet summary is built, the facets are built even if the facet has no active items. Skipping this on facets that take a long time to build would be an improvement in performance.

CommentFileSizeAuthor
#3 don_t_build_facet_in-2919705-3.patch830 bytesmmrares
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mmrares created an issue. See original summary.

borisson_’s picture

Issue tags: +Performance, +needs profiling

This sounds like a great idea, if all the tests we have still pass we can indeed make a big win here.

We would need to have profiling data to back this up before this goes in (no matter what the patch is), so we can show off the improvements we made. Doing this with a tool such as boom/ab should be sufficient.

mmrares’s picture

borisson_’s picture

Status: Active » Needs review

Setting to needs review so the testbot can see if something breaks.

borisson_’s picture

Without patch:

boom -c 1 -n 100 http://search.dev/search/content?keys=pecus\&f%5B0%5D=content_type%3Aarticle

Summary:
  Total:	137.7983 secs.
  Slowest:	1.4593 secs.
  Fastest:	1.2816 secs.
  Average:	1.3780 secs.
  Requests/sec:	0.7257

With patch:

boom -c 1 -n 100 http://search.dev/search/content?keys=pecus\&f%5B0%5D=content_type%3Aarticle

Summary:
  Total:	140.7741 secs.
  Slowest:	1.7616 secs.
  Fastest:	1.2541 secs.
  Average:	1.4077 secs.
  Requests/sec:	0.7104

So there is a small increase in requests/second but not enough to notice. We should see if blackfire or xhprof gives us a better result - otherwise it looks like this doesn't really help.

mmrares’s picture

We have a few facets with 300+ values where this patch helps. Do the tests include facets with a lot of values?

borisson_’s picture

Status: Needs review » Needs work

No, I only have ~20 nodes on my testsite. I'll try again tonight/tomorrow.

borisson_’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -needs profiling

I now have a facet with ~50 items (generated terms)

Summary:
  Total:	165.0995 secs.
  Slowest:	4.0573 secs.
  Fastest:	1.5837 secs.
  Average:	1.6510 secs.
  Requests/sec:	0.6057

With patch:

Summary:
  Total:	139.8320 secs.
  Slowest:	1.5906 secs.
  Fastest:	1.3638 secs.
  Average:	1.3983 secs.
  Requests/sec:	0.7151

Yeah, this is an awesome improvement. Thanks so much!

StryKaizer’s picture

Status: Reviewed & tested by the community » Fixed

Thx!

  • StryKaizer committed ce38b04 on 8.x-1.x authored by mmrares
    Issue #2919705 by mmrares, borisson_: Don't build facet in summary if...

Status: Fixed » Closed (fixed)

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