Skip to content

v0.9.3.1

Choose a tag to compare

@PieOrCake PieOrCake released this 09 Apr 23:37
· 34 commits to main since this release

Performance Fix: Reduce ImGui Text Input Lag

Nexus addons share the same ImGui context and render sequentially in the same frame. Expensive per-frame computation causes keystrokes to arrive between frames and get dropped, resulting in laggy text input fields.

Changes

  • Cached song durations — Song::GetTotalDurationSeconds() previously iterated every note event (potentially thousands) on every call. It was called per visible row per frame in both the library and playlist tables, plus in sort comparisons. Now uses a lazy mutable cache computed once on first access.
  • Cached instrument counts & artist lists — The library and download panes previously rebuilt std::map/std::set of instrument counts and artist names by iterating all songs every frame with string copies. Now cached and only recomputed when library content changes or the instrument tab changes.
  • Cached filtered & sorted lists — Filter/sort operations (O(N) string lowercasing + O(N log N) sort) previously ran every frame. Now use dirty-flag tracking: the filtered+sorted index list only rebuilds when filter text, artist selection, instrument tab, sort column/direction, or library size actually changes.

Result

On a steady-state frame with no user interaction, the render path now does zero data iteration — just ImGui widget drawing from cached vectors. All recomputation only triggers on actual user input.