Skip to content

GPS graphic: optimize drawing by skipping overlapping lines - #1338

Merged
ddennedy merged 11 commits into
masterfrom
gps/gpsgraph_draw_optimization
Oct 17, 2026
Merged

ddennedy merged 11 commits into
masterfrom
gps/gpsgraph_draw_optimization

Conversation

@dany123

@dany123 dany123 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor
  • Skip drawing GPS line segments until the track moves more than one pixel
  • Jump directly between valid GPS points when drawing
  • Calculate GPS frame time from frame position and profile FPS instead of formatting and parsing a time string under a mutex.
  • Cache the GPS processing start-time string to avoid reparsing it every frame; update processing only when the value changes.
  • some cleanup

The GPS graphic change is the major one, obviously depends on the track length and zoom level but a best case scenario where fully drawing an 8h GPS track on a 1 min color clip renders in 36s now vs 1m15s before (with the default x264 export).

Point skipping is huge, but there's still plenty of overhead so only 2x faster export:

  • skipped 19874 out of 28330 on a 1920x1080 drawn map
  • skipped 26178 out of 28330 on a 412x326 map (so an actual scenario where map is shown on a bottom-right position)

The mutex change drops the frame time calculation from ~1ms to 0.05ms (from memory, I had these written down but I overwrote them by mistake). The last_read_gps_processing_start_time also drops from a ~1ms to under 0.1ms.
But overall the GPS text filter is still slow, not sure why, the entire filter_process takes ~1ms, almost identical to GPS drawing but text is significantly slower to export. It's still slightly faster than before so oh well...

(I think some commits from the old PR show up because I had merge conflicts on git rebase master)

@dany123
dany123 requested a review from ddennedy October 6, 2026 23:52
@dany123

dany123 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Quick question: should I ask for a copilot review every pr? I don't know if this is free/paid/limited free credits and if lite/balanced matters.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

GPS drawing has unresolved correctness and logging issues, along with a copyright-year update.

1 open finding
What changed in this PR

This pull request optimizes GPS rendering and timestamp processing for faster exports.

Changes:

  • Skips redundant GPS segments and jumps between valid points.
  • Calculates frame time directly from frame position and FPS.
  • Caches GPS processing timestamps and updates parser interfaces.
File Summary
src/​tests/​test_mod_qt_gps/​test_mod_qt_gps.cpp Updated test declarations; copyright year should be updated to 2026.
src/​modules/​qt/​gps_parser.h Updated parser declaration.
src/​modules/​qt/​gps_parser.cpp Updated parser definition and format parameter.
src/​modules/​qt/​gps_drawing.cpp Optimized track drawing; repeated logging, dots-only rendering, and data-dependent color changes need correction.
src/​modules/​qt/​filter_gpstext.cpp Added processing timestamp caching.
src/​modules/​qt/​filter_gpsgraphic.h Renamed the valid-point helper.
src/​modules/​qt/​filter_gpsgraphic.cpp Updated frame-time calculation and valid-point handling.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/modules/qt/gps_drawing.cpp Outdated
@ddennedy ddennedy added this to the v7.44.0 milestone Oct 17, 2026
@ddennedy
ddennedy merged commit d08fb78 into master Oct 17, 2026
15 checks passed
@ddennedy
ddennedy deleted the gps/gpsgraph_draw_optimization branch October 17, 2026 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants