Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pool vectors for photons to improve performance #304

Open
jbphet opened this issue Jun 19, 2023 · 1 comment
Open

Pool vectors for photons to improve performance #304

jbphet opened this issue Jun 19, 2023 · 1 comment

Comments

@jbphet
Copy link
Contributor

jbphet commented Jun 19, 2023

While working on phet-io state, @zepumph suggested that photon movement and state setting might be more efficient if we use pooling for the vectors.

There are apparently some good examples in Projectile Motion, search for Vector2.pool.create( to see them.

@zepumph
Copy link
Member

zepumph commented Jun 19, 2023

Yes this seems like it would be pretty dang easy to implement inside of Photon.ts, and would give us some gains. Over in #301 we didn't see a bunch of performance problems when setting a couple thousand photons to the state (<500ms on average), but if this is simple, since we KNOW just how many objects are being used and discarded, it seems worth while. I would have it on a lowish priority, and its potential simplicity would up it a medium priority.

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

No branches or pull requests

2 participants