-
Notifications
You must be signed in to change notification settings - Fork 366
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
Slow HeightfieldShape Save/RestoreBinaryState #1080
Comments
That's a good find! Unfortunately, the suggested solution won't work as e.g. Vec3 is is_trivial and is_trivially_copyable but it requires calling the custom Read(Vec3 &) function to avoid writing garbage for the unused W component. Let me cook something up. |
jrouwe
added a commit
that referenced
this issue
Apr 30, 2024
Reading arrays of simple types in a single read instead of per element. Fixes #1080
jrouwe
added a commit
that referenced
this issue
Apr 30, 2024
Reading arrays of simple types in a single read instead of per element. Fixes #1080
Should be fixed now, thanks for reporting this! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have a 8192x8192 heightfield. RestoreBinaryState takes 1231ms on a Galaxy A51 phone.
Most of the time spent with reading vector elements (mRangeBlocks, mHeightSamples, mActiveEdges)
JoltPhysics/Jolt/Core/StreamIn.h
Line 44 in 40dc670
I have modified the StreamIn vector reader to read the whole vector data with one call. This takes 114ms on the same phone.
I am not sure about is_trivial_v maybe it should be is_trivially_copyable?
Our deserialization code looks like this. The ReadBytes is a virtual function which gets called with small sizes.
The text was updated successfully, but these errors were encountered: