Hubs-Foundation / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.
https://hubsfoundation.org
Mozilla Public License 2.0
2.13k stars 1.42k forks source link

Disable matrix optimizations #1859

Open johnshaughnessy opened 4 years ago

johnshaughnessy commented 4 years ago

Is your feature request related to a problem? Please describe. Our matrix optimizations are a frequent source of confusion. I would find it helpful in debugging to be able to fall back to the default THREE.js behavior or even some "slow and dumb" contract whereby setting any of an object3D's position, rotation, quaternion, scale, matrix, worldMatrix, or parent will cause the reset of the properties to update.

Describe the solution you'd like An easy way to disable our matrix optimizations for debugging purposes.

┆Issue is synchronized with this Jira Task

johnshaughnessy commented 4 years ago

TODO:

imskr commented 4 years ago

I want to work on this issue @johnshaughnessy Please assign!

gfodor commented 4 years ago

Just FYI, I did extensive benchmarking when I wrote these optimizations, and they are relatively huge wins performance wise. I can dig up the numbers if you want.

On Sat, Jan 11, 2020 at 12:04 AM Shubham Kumar notifications@github.com wrote:

I want to work on this issue @johnshaughnessy https://github.com/johnshaughnessy Please assign!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mozilla/hubs/issues/1859?email_source=notifications&email_token=AABVW5BI5X2O4QQYOY5B4KTQ5F4RXA5CNFSM4JENDSK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIV4HVQ#issuecomment-573293526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVW5DX24HZA22HQGPYMXTQ5F4RXANCNFSM4JENDSKQ .

gfodor commented 4 years ago

Also I did not use the profiler to measure this, but did a series of real world benchmarking

On Sat, Jan 11, 2020 at 1:01 PM Greg Fodor gfodor@gmail.com wrote:

Just FYI, I did extensive benchmarking when I wrote these optimizations, and they are relatively huge wins performance wise. I can dig up the numbers if you want.

On Sat, Jan 11, 2020 at 12:04 AM Shubham Kumar notifications@github.com wrote:

I want to work on this issue @johnshaughnessy https://github.com/johnshaughnessy Please assign!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mozilla/hubs/issues/1859?email_source=notifications&email_token=AABVW5BI5X2O4QQYOY5B4KTQ5F4RXA5CNFSM4JENDSK2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIV4HVQ#issuecomment-573293526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABVW5DX24HZA22HQGPYMXTQ5F4RXANCNFSM4JENDSKQ .

gfodor commented 4 years ago

Also, the multiplication isn’t really the issue, it’s the high number of functional calls and all the conditional branching. Even slightly changing the control flow (eg not short circuiting recursion well, or stepping into a branch unnecessarily) often yielded measurable consequences given how much these routines are hit.

joshmarinacci commented 4 years ago

What was the resolution on this? @fernandojsg @netpro2k