Skip to content

Conversation

@gnarhard
Copy link
Contributor

@gnarhard gnarhard commented Jan 6, 2026

Description

Currently, MoveEffect, ScaleEffect, and SizeEffect each create a bunch of unnecessary Vector2 objects in apply() which runs in the update loop. Migrating to using the vector methods to handle the mutation of those objects should reduce per-frame object churn and GC pressure.

I also added the ability to change the destination in MoveEffects to allow for more flexibility when pooling.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

@gnarhard gnarhard changed the title Perf: Use vector methods for vector mutation in MoveEffect, SizeEffect, and ScaleEffect perf: Use vector methods for vector mutation in MoveEffect, SizeEffect, and ScaleEffect Jan 6, 2026
@gnarhard
Copy link
Contributor Author

gnarhard commented Jan 6, 2026

Jeez, that broke a bunch of tests, I'm bailing on this.

@gnarhard gnarhard closed this Jan 6, 2026
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.

1 participant