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

Analyses submission in Worksheet is slow #776

Merged
merged 19 commits into from
Apr 27, 2018
Merged

Conversation

xispa
Copy link
Member

@xispa xispa commented Apr 21, 2018

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.

xispa added 7 commits April 21, 2018 23:43
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
xispa and others added 10 commits April 24, 2018 11:12
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.
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
Copy link
Contributor

@ramonski ramonski left a 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!:)

@ramonski ramonski merged commit 1eb869a into master Apr 27, 2018
@ramonski ramonski deleted the analysis-submit-slow branch May 20, 2018 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants