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

Inline Matrix3 element functions? #67

Open
samreid opened this issue Jun 14, 2017 · 3 comments
Open

Inline Matrix3 element functions? #67

samreid opened this issue Jun 14, 2017 · 3 comments
Assignees

Comments

@samreid
Copy link
Member

samreid commented Jun 14, 2017

While working on phetsims/circuit-construction-kit-common#295 @jonathanolson and I noticed that Safari iPad3 tethering reported a non-negligible amount of time being spent in the Matrix3 element functions like m00, m01, etc.

We tried a CCK-DC test with the usual m00 style functions and saw ?profiler report between 21-22 frames per second. When inlining these functions (and using array accessors instead), the performance reported 22-23 frames per second. We only ran this test once, it would be good to confirm and run on other hardware such as iPad2.

Replacing the named element accesses with indexed array accesses would make Matrix3 harder to read and understand and maintain, but may buy us a bit of performance across all our sims.

@pixelzoom
Copy link
Contributor

pixelzoom commented Jun 14, 2017

... may buy us a bit of performance across all our sims.

Can this be quantified? Will it be significant to the user experience? (The reported improvement for CCK:DC was only 22fps to 23fps.)

@jonathanolson
Copy link
Contributor

If it's the difference between 22 and 23 fps, that's almost a 2ms difference. If that stays somewhat constant from a ~45ms frame to a ~16ms frame (~60fps), it would be a more significant difference. If an almost-60fps sim would instead only gain 0.7ms a frame, it's still potentially relevant.

@samreid
Copy link
Member Author

samreid commented Jun 14, 2017

I'm inclined to investigate things like WebGL phetsims/circuit-construction-kit-common#367 first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants