-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Indexing.py: Item init is called several times with the same query values when viewing an item #1778
Comments
To prove the impact of the redundant queries I wrote a short cache function in commit 3e933ed.
The response time dropped to 900 ms, and the display of the metadata immediately afterwards takes around 100 ms. I need help and support on this issue. I did not see any call to the Items init function where latest_doc was used. This parameter should avoid running the same query repeatedly. |
Several of those queries are caused by I wonder what this line is intended for: moin/src/moin/templates/itemviews.html Line 10 in 807bfe1
Is there any use case where the template is called for a non-existent element? |
Good catch; I cannot think of a case where the template is called for a non-existent element. Agree with your suggestion to move user.may.write to views.py and pass into context. |
The above fix reduces the response time in the above example to about 1500 ms - that is a reduction of 30 %. For smaller wikis, the reduction is only around 10 to 15 %. |
Running a diff from an item history gives following traceback:
|
The index queries for /TestItem/Discussion above can be ommited if the Discussion feature is not used.
I will add comments in wikiconfig.py . |
While running performance tests on an imported wiki I found that the Item init method
moin/src/moin/storage/middleware/indexing.py
Line 1064 in 807bfe1
is called several times with the same query values. Each Query causes a whoosh index query. Because of the index size for a wiki with 2400 items and about 12000 revisions each index query lasts about 120 ms. The following server output was produced with additional clock timers, see commit 26bd5dc.
For the test I created a simple MoinWiki item called 'TestItem' with a header only.
Viewing the meta data of this item afterwards takes nearly the same time (2.5 secs).
The text was updated successfully, but these errors were encountered: