-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
Analyses submission in Worksheet is slow #776
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
is_uid function calls to uid_catalog directly to see if the uid is valid. get_object calls this function first to check if the uid is valid, but do a search against the catalog to obtain the object. With this commit, we use api's get_uid (that does not validate against uid_catalog by default) to check the uid, so only one query is done at the end.
When doAction is not possible, the system was obtaining the available transitions for the given object to print them in the log only. We can remove this overhead.
api's is_active works with brains, while isActive from workflow always look through the workflow chain
This function is no longer used, api.is_uid is used everywhere instead
Most of the overhead during analyses submission was because of their relationship with instruments and reference analysis validity. This commit lightens content.instrument and makes the submission of analyses more optimal.
… analysis-submit-slow
Moved browser.analyses.py and browser.late_analyses.py inside
Revert _get_object changes in uidreferencefield. In that situation, the context is not available
Conflicts: bika/lims/browser/analysisrequest/workflow.py bika/lims/upgrade/v01_02_005.py
ramonski
approved these changes
Apr 27, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went through all the commits and read your messages and the code. Well done, bravo!:)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the issue/feature this PR addresses
This PR contains some bits to improve the performance when submitting results of analyses in Worksheet. The system was behaving slow, specially when analyses had instruments assigned.
With this PR, the submission of 50 analyses in a Worksheet took 90s (before, it took more than 7m). One AR per Analysis and all analyses with instrument and method assigned. Used my laptop and instance in fg mode.
--
I confirm I have tested this PR thoroughly and coded it according to PEP8
and Plone's Python styleguide standards.