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

Searching: Do some profiling #157

Closed
sbrl opened this issue Jun 25, 2018 · 3 comments
Closed

Searching: Do some profiling #157

sbrl opened this issue Jun 25, 2018 · 3 comments
Labels
bug Squash it quick!

Comments

@sbrl
Copy link
Owner

sbrl commented Jun 25, 2018

The personal wiki I'm powering with Pepperminty Wiki has grown tot he point where searching is beginning to take ~1.1s. We should do some profiling to figure out if there's some optimising we can do to bring this down a bit.

@sbrl sbrl added the bug Squash it quick! label Jun 25, 2018
@sbrl
Copy link
Owner Author

sbrl commented Jun 25, 2018

I've optimised the search context extractor a lot, but it doesn't seem to have helped much :-(

Further investigation is needed.

@sbrl sbrl closed this as completed Jun 25, 2018
@sbrl sbrl reopened this Jun 26, 2018
@sbrl
Copy link
Owner Author

sbrl commented Jun 26, 2018

After doing some profiling with XDebug, a few things have come to light.

Looks like optimising the page id system has helped a lot! Next we need to utilise the inverted index in the search context extractor instead of running a regex. It's not the regex that's the issue curiously enough - it's the transliteration of the entire page content that's slowing us down.

@sbrl
Copy link
Owner Author

sbrl commented Jun 26, 2018

Yas! that did teh trick. Now context generation takes a much more respectable 59ms on average - a ton better than the ~1100m s from before.

Also, turns out getting page ids is comparatively expensive - so spending some time both optimising it and minimising the number of calls to it has done wonders.

@sbrl sbrl closed this as completed Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Squash it quick!
Projects
None yet
Development

No branches or pull requests

1 participant