Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix searchable item checking #2643

Merged
merged 6 commits into from
Oct 12, 2020
Merged

Fix searchable item checking #2643

merged 6 commits into from
Oct 12, 2020

Conversation

jasonvarga
Copy link
Member

@jasonvarga jasonvarga commented Oct 12, 2020

Closes #1722

When you save an entry (or term, or asset, etc) it updates the search indexes.
It looks through all the configured indexes, and checks whether the entry belongs in that index.

It did this by getting all the items that should be in the index, and check to see if that entry was in that array. Stupid in hindsight, but was simple to write originally and wasn't testing with enough content to notice a performance issue.

When you have a butt-tonne of entries (or assets, as per the issue) it has to do a lot of work to get all of them.
The problem is compounded when your assets are on S3 which is even slower.

This check has been reworked to just check against the rules and doesn't need to bother getting all the searchables.

Saving an entry on my 14,000-asset test site went from 7 seconds down to 150ms.

Code is not the prettiest but I'll take that over the load time.

Rather than getting all the items again (which would have a ton of overhead in the case of lots of assets, for example) just check against the configured rules.
@jasonvarga jasonvarga merged commit d656c87 into master Oct 12, 2020
@jasonvarga jasonvarga deleted the fix/searchable branch October 12, 2020 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slow entry creation and edit when we have a lot of assets
1 participant