Skip to content

Optimization & bug fixes for PerfGraph#1265

Merged
einarf merged 56 commits intopythonarcade:developmentfrom
pushfoo:optimize_perf_graph
Jul 30, 2022
Merged

Optimization & bug fixes for PerfGraph#1265
einarf merged 56 commits intopythonarcade:developmentfrom
pushfoo:optimize_perf_graph

Conversation

@pushfoo
Copy link
Member

@pushfoo pushfoo commented Jul 6, 2022

tl;dr ~7% faster, fixes bugs, backward compatible

These changes seem to run at least 7% faster and with far more FPS stability than the current development branch. Most of the improvement is likely from the removal of arcade.draw_text.

Major changes:

  • Switch to arcade.Text instances instead of arcade.draw_text calls
  • Use batched mutable pyglet.graphics.Line instances for non-data lines
  • Convert multiple attributes into backward-compatible properties that update mutable pyglet shapes
  • Fix rendering bugs when PerfGraph instances are scaled

Performance comparison:

These screen shots are toward the maximum improvement (52 FPS is the minimum on development for my system). 7% improvement seems to be the average. Getting exact numbers doesn't seem worth the time at the moment, but the improved FPS stability of the PR version is worth noting.

Before:
image
After:
image

@pushfoo pushfoo changed the title Optimize PerfGraph by removing draw_text calls 7% speed boost & bug fixes for PerfGraph Jul 26, 2022
@pushfoo pushfoo force-pushed the optimize_perf_graph branch from 1d33db0 to b986e8b Compare July 26, 2022 05:44
@pushfoo pushfoo marked this pull request as ready for review July 27, 2022 02:13
@pushfoo pushfoo changed the title 7% speed boost & bug fixes for PerfGraph Optimization & bug fixes for PerfGraph Jul 27, 2022
@einarf
Copy link
Member

einarf commented Jul 30, 2022

Let's just merge this. It will be be first feature using pyglet batches in arcade 👍 (Since this is now possible in 2.7)

@einarf einarf merged commit 33ca787 into pythonarcade:development Jul 30, 2022
@pushfoo pushfoo deleted the optimize_perf_graph branch August 5, 2022 23:39
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.

2 participants