Using integer vector multiplication function to speed up engine and godot physics #11322
Replies: 3 comments
-
Since this is more of a proposal than a bug report, I moved it to the dedicated Godot proposals repository (as a discussion). We use the main Godot repository only for bug reports and pull requests. |
Beta Was this translation helpful? Give feedback.
-
The video is about using SIMD. "Integer vector multiplication" in the title suggested to me that you wanted physics working with integers instead of floats. |
Beta Was this translation helpful? Give feedback.
-
Note that using SIMD intrinsics manually increases the maintenance burden, and Jolt is slated to replace GodotPhysics3D in the long run anyway. There may be specific instances outside of physics where using SIMD manually can make sense, but it needs to be an established bottleneck first. Compiler optimizations could be made to use newer instruction standards as proposed in #3932, but we can't go above SSE4.2 without breaking support for old/low-end Intel CPUs. Godot would stop running entirely on those CPUs if we required AVX, let alone AVX2. This is due to Intel doing market segmentation on its Atoms/Celerons/Pentiums until ~2020 – these CPUs only support up to SSE4.2. Separate binaries can be used to support both old and new CPUs, but doing so would cause the build matrix to grow further and make official build times very long. |
Beta Was this translation helpful? Give feedback.
-
Tested versions
Godot 4.2 and 4.3 dev
System information
Windows, Android.
Issue description
This video does a good job of describing a solution that will significantly speed up physics and other parts of the engine by using CPU instructions for vector multiplication.
https://www.youtube.com/watch?v=FSyrZ0Z9Yug&ab_channel=mohsenzare
Steps to reproduce
Transfer vector multiplication from Jolt or write implementation.
Minimal reproduction project (MRP)
No project
Beta Was this translation helpful? Give feedback.
All reactions