BeatPreview for Pattern Clip causes lag
- Dominant language
- C++
- Stars
- 10.4k
- Forks
- 1.3k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 7
Description
### System Information
Windows 11; i5 12400; 64 GB RAM
### LMMS Version(s)
master, Version 1.3.0-alpha.1.937+13ea2ee (win32/x86_64, Qt 5.15.6, GCC 13-win32).
### Most Recent Working Version
Version 1.3.0-alpha.1.900+dc2a461 (unknown platform/unknown processor, Qt 5.15.6, GCC 13-win32).
### Bug Summary
#7559 introduces a beat preview to the pattern clip view in song editor.
After this, when the pattern in song editor has several dozens of tracks then scrolling and zooming in the song editor lag extremely even though the rendered view is just a white block.
I cannot claim it is certainly caused by this issue because the latest nightly I have without the issue was from November (the feature was merged in December) and it could be anything between that and my reference nightly (downloaded in January)
### Expected Behaviour
When there are hundreds of overall notes or several dozens of active and filled tracks with enough notes (not if there are 30 tracks but only one has notes at all) then do not render preview / show only block without wasting resources calculating.
### Steps To Reproduce
Open attached file in LMMS master build vs a build before #7559.
### Logs
_No response_
### Screenshots / Minimum Reproducible Project
https://github.com/user-attachments/assets/f167dde5-0524-42dd-a51d-6dfa576b1d55
I know the build that shows the bug in this video is relatively recent, but I checked the bug against my Version 1.3.0-alpha.1.937+13ea2ee (win32/x86_64, Qt 5.15.6, GCC 13-win32). (has bug)
the build without bug is Version 1.3.0-alpha.1.900+dc2a461 (unknown platform/unknown processor, Qt 5.15.6, GCC 13-win32).
File used:
[lb302-torture.zip](https://github.com/user-attachments/files/28030372/lb302-torture.zip)
It will take several minutes to load, please be patient.
### Please search the issue tracker for existing bug reports before submitting your own.
- [x] I have searched all existing issues and confirmed that this is not a duplicate.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by comparing the BeatPreview change introduced in #7559 and reproducing the lag in the song editor with the attached lb302-torture.zip project. Check scrolling and zooming with dense patterns, then verify that preview rendering is skipped or reduced when it causes the reported performance problem.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop-dev, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100