netgen / TagsBundle

Netgen Tags Bundle is an eZ Platform bundle for taxonomy management and easier classification of content, providing more functionality for tagging content than ezkeyword field type included in eZ Platform kernel.
https://netgen.io
GNU General Public License v2.0
48 stars 44 forks source link

Hugh performance issues on heavy Tags usage #92

Closed andrerom closed 5 years ago

andrerom commented 5 years ago

It's been observed by several (partners, eZ folks) that Tags bundle does not perform at all due to excessive cache lookups, the issue is most visible on v2 as in-memory cache on v1 tends to hide it. From profiling @bdunogier could see 4 duplicate lookups for tags due to fromHash() being implicitly called several times, and this seems to correspond to what @dspe observed during an audit too.

From initial look it seems two things could be done in fromHash:

Or the lookup should rather be done in external storage or something.

Local cache might not be needed once we ship SPI cache with in-memory cache in 2.5, but TagsHandler will need to be adapted for it will most likely be per handler logic.

emodric commented 5 years ago

Thanks for the report @andrerom 👍

If you have specific suggestions on how to improve ( a PR ;) ), I'll gladly merge them!

andrerom commented 5 years ago

Not really as it seems to go deep, but I might be wrong, @bdunogier was the one spotting this so he might know.

emodric commented 5 years ago

@andrerom Will this be closed by #97 ?

andrerom commented 5 years ago

Mostly, so yes you can close this once it's merged.

Remaining issues:

emodric commented 5 years ago

Mostly, so yes you can close this once it's merged.

:+1:

why kernel called fromHash several times (4) in the profilings done, as opposed to just once

I'll try to investigate.

emodric commented 5 years ago

Mostly fixed by #97