Issue 45344: experiment-showMaterial.view fetches ProtocolApplications way too often

issues
Status:closed
Assigned To:Guest
Type:Defect
Area:Experiment
Priority:3
Milestone:22.07
Opened:2022-04-27 09:44 by jeckels
Changed:2022-05-03 14:51 by jeckels
Resolved:2022-04-29 16:40 by jeckels
Resolution:Fixed
Related:45345, 45402
Support Ticket: 
Pull Requests:platform#3295
Closed:2022-05-03 14:49 by jeckels
Related Issues
2022-04-27 09:44 jeckels
Title»experiment-showMaterial.view fetches ProtocolApplications way too often
Assigned To»jeckels
Type»Defect
Area»Experiment
Priority»3
Milestone»22.07
Looking at the HTTP request response times, experiment-showMaterial.view is sometimes very slow on labkey.org (10+ seconds).

Here's an example URL that takes about 25 seconds to render:

https://www.labkey.org/ExploreSampleManager/experiment-showMaterial.view?rowId=872651&returnUrl=%2FExploreSampleManager%2Fexperiment-showSampleType.view%3FrowId%3D330

Which is actually pretty fast given that looking up an exp.ProtocolApplication by RowId about 25,000 times to render the one request. The vast majority are coming through ExperimentServiceImpl.populateRun() so that we can render the related runs grid at the bottom of the page.

What's really fun is that we're fetching the ExpProtocolApplication object so that we can get its RowId. But we already had the RowId, which is how we look up the ExpProtocolApplication object. I think we're also visiting runs multiple times in ExperimentController.ShowMaterialAction.

2022-04-27 11:09 jeckels
Related»45345

2022-04-27 13:24 jeckels
Pull Requests»https://github.com/LabKey/platform/pull/3295

2022-04-29 16:40 jeckels
resolve as Fixed
Statusopen»resolved
Now merged to develop, in time for 22.5.

2022-05-03 14:49 jeckels
close
Statusresolved»closed
Assigned Tojeckels»Guest
Down from 25 seconds to 1.5 seconds. One followup idea for more speed.

2022-05-03 14:51 jeckels
Related45345»45345, 45402