Ticket #1872 (closed: fixed)
3D Instrument View: improve startup performance for large instruments.
Reported by: | Janik Zikovsky | Owned by: | Janik Zikovsky |
---|---|---|---|
Priority: | major | Milestone: | Iteration 26 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Michael Whitty |
Description
It takes a couple of seconds event on a fast computer to build up the color list for all pixels on e.g. TOPAZ. Perhaps parallelization is the way to make it faster, or maybe re-work the way colors get passed down.
Change History
comment:2 Changed 10 years ago by Janik Zikovsky
- Summary changed from 3D Instrument View: would it be possible to build textures for RectangularDetector's in parallel? to 3D Instrument View: improve startup performance for large instruments.
Here is the timing for the WISH instrument (WISH00016748 file) before any changes:
Instrument3DWidget::ParseInstrumentGeometry() took 0.294798 seconds Instrument3DWidget::calculateBinRange() took 19.0522 seconds Instrument3DWidget::calculateColorCounts(): mInstrumentActor->getDetectorIDList() took 0.277472 seconds Instrument3DWidget::createWorkspaceIndexList() took 0.744245 seconds Instrument3DWidget::calculateColorCounts():Integrating workspace took 39.0107 seconds
1281 GL 1d error1
Instrument3DWidget::calculateColorCounts(): mInstrumentActor->setDetectorColors() took 0.034032 seconds Instrument3DWidget::calculateColorCounts() took 40.2688 seconds Instrument3DWidget::setWorkspace() took 59.6285 seconds
It can be seen that getting the bin range and calculating the color counts are, by far, the slowest operations and are the first spots to optimize.
comment:3 Changed 10 years ago by Janik Zikovsky
Timing for SNAP_4105:
Instrument3DWidget::ParseInstrumentGeometry() took 0.011403 seconds Instrument3DWidget::calculateBinRange() took 0.101935 seconds Instrument3DWidget::calculateColorCounts(): mInstrumentActor->getDetectorIDList() took 0.29363 seconds
Instrument3DWidget::createWorkspaceIndexList() took 3.34379 seconds Instrument3DWidget::calculateColorCounts():Integrating workspace took 4.74109 seconds Instrument3DWidget::calculateColorCounts(): mInstrumentActor->setDetectorColors() took 0.051766 seconds
Instrument3DWidget::calculateColorCounts() took 11.0607 seconds Instrument3DWidget::setWorkspace() took 11.2118 seconds
comment:6 Changed 10 years ago by Janik Zikovsky
My upcoming check in timing results, for the part of the calculation to integrate the counts (the slowest part):
File SNAP_4111, EventWorkspace.
As a pseudo-workspace 2D, binned to 1600 bins: Non parallelized: 47 seconds after sorting event list.
As a pseudo-workspace 2D, binned to 16000 bins: Non parallelized: 401 seconds after sorting event list.
As an event workspace: Non-parallelized: 30 seconds. Parallelized, first run: 5.5 seconds. Parallelized, second run: 0.3 seconds.
So the speed improvement is easily x100 times, up to x1000 times for very finely binned workspaces!
comment:7 Changed 10 years ago by Janik Zikovsky
(formatting fix)
My upcoming check in timing results, for the part of the calculation to integrate the counts (the slowest part):
File SNAP_4111, EventWorkspace.
As a pseudo-workspace 2D, binned to 1600 bins:
- Non parallelized: 47 seconds after sorting event list.
As a pseudo-workspace 2D, binned to 16000 bins:
- Non parallelized: 401 seconds after sorting event list.
As an event workspace:
- Non-parallelized: 30 seconds.
- Parallelized, first run: 5.5 seconds.
- Parallelized, second run: 0.3 seconds.
So the speed improvement is easily x100 times, up to x1000 times for very finely binned workspaces!
comment:9 Changed 10 years ago by Janik Zikovsky
Next up:
Instrument3DWidget::calculateColorCounts(): mInstrumentActor->getDetectorIDList() took 2.7619 seconds
and
Instrument3DWidget::createWorkspaceIndexList() took 3.47304 seconds
... these two are the slowest steps now.
comment:10 Changed 10 years ago by Janik Zikovsky
comment:11 Changed 10 years ago by Janik Zikovsky
comment:12 Changed 10 years ago by Janik Zikovsky
- Status changed from accepted to verify
- Resolution set to fixed
comment:13 Changed 10 years ago by Michael Whitty
- Status changed from verify to verifying
- Tester set to Michael Whitty
comment:14 Changed 10 years ago by Michael Whitty
- Status changed from verifying to closed
indeed, performance is much improved. Testing with TOPAZ, pick completely fails pre these changes, and works well in recent builds.
comment:15 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 2719
As an add-on, consider how integrating the colors takes time...