Repository navigation
Fix TOPPView performance when right clicking in large mzML - #8997
Conversation
…rge mzML tages ages, due to copying of the whole map multiple times)
📝 WalkthroughWalkthroughThe Changes
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/openms_gui/source/VISUAL/Plot2DCanvas.cpp (1)
1554-1563: Use OpenMS count/index types consistently in the new bookkeeping.
indices.size()is asize_t, whilemax_countandindexare rawints here. That mixes signed/unsigned arithmetic in the loop guards and menu indices.As per coding guidelines, "Use OpenMS primitive types from
OpenMS/CONCEPT/Types.hinstead of standard C++ types."Also applies to: 1567-1576
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/openms_gui/source/VISUAL/Plot2DCanvas.cpp` around lines 1554 - 1563, The new bookkeeping mixes std types and raw ints—change the container and counters to OpenMS primitives: replace std::vector<size_t> indices with std::vector<Size> (from OpenMS/CONCEPT/Types.h), make max_count use Size, and compute the scan index in the addMS2ScanIfValid lambda using an OpenMS Size (e.g. cast the pointer/distance result to Size) instead of raw int; where APIs require signed ints (e.g. menu insertion calls), perform a single explicit cast at the call site. Ensure all comparisons and loop guards use the same OpenMS Size/Int types (indices, max_count, index) to avoid signed/unsigned mixing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/openms_gui/source/VISUAL/Plot2DCanvas.cpp`:
- Around line 1543-1586: The outward walk can continue past the RT window
because each side only tests one boundary per iteration; change the loop so each
direction stops permanently once that side's iterator leaves the RT window: when
checking it_left, if it_left->getRT() < range.getMinRT() set it_left =
peak_data.end() (or otherwise mark left finished) and do not decrement further;
when checking it_right, if it_right->getRT() > range.getMaxRT() set it_right =
peak_data.end() (or mark right finished) and do not increment further; also
ensure the initial center_it may be outside range and treat that side as already
finished if center_it->getRT() is out of bounds. Apply these checks around the
existing addMS2ScanIfValid/RT tests (symbols: center_it, it_left, it_right,
peak_data, range, addMS2ScanIfValid, max_count) so we stop walking a side once
its RT crosses the window.
---
Nitpick comments:
In `@src/openms_gui/source/VISUAL/Plot2DCanvas.cpp`:
- Around line 1554-1563: The new bookkeeping mixes std types and raw ints—change
the container and counters to OpenMS primitives: replace std::vector<size_t>
indices with std::vector<Size> (from OpenMS/CONCEPT/Types.h), make max_count use
Size, and compute the scan index in the addMS2ScanIfValid lambda using an OpenMS
Size (e.g. cast the pointer/distance result to Size) instead of raw int; where
APIs require signed ints (e.g. menu insertion calls), perform a single explicit
cast at the call site. Ensure all comparisons and loop guards use the same
OpenMS Size/Int types (indices, max_count, index) to avoid signed/unsigned
mixing.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9d0919b7-df66-4f7f-afde-25ba985afc89
📒 Files selected for processing (2)
src/openms_gui/include/OpenMS/VISUAL/Plot2DCanvas.hsrc/openms_gui/source/VISUAL/Plot2DCanvas.cpp
Add missing entries for: - #8991: Arrow/Parquet made required dependency; WITH_PARQUET CMake option removed - #8993: BREAKING IMFormat enum rename (CONCATENATED→IM_PEAK, MULTIPLE_SPECTRA→IM_SPECTRUM) - #8997: Fix TOPPView performance regression when right-clicking in large mzML - #8999: BrukerTimsFile tiered scan→1/K0 calibration with RationalScan2ImConverter Co-authored-by: Copilot <[email protected]>
Add missing entries for: - #8991: Arrow/Parquet made required dependency; WITH_PARQUET CMake option removed - #8993: BREAKING IMFormat enum rename (CONCATENATED→IM_PEAK, MULTIPLE_SPECTRA→IM_SPECTRUM) - #8997: Fix TOPPView performance regression when right-clicking in large mzML - #8999: BrukerTimsFile tiered scan→1/K0 calibration with RationalScan2ImConverter Co-authored-by: GitHub Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
Description
fix performance bug introduced in #7974
also: limit number of fragment scans in context menu list
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI buildsSummary by CodeRabbit
Release Notes