diff options
| author | Sakarias Johansson <sakarias.johansson@goodbyekansas.com> | 2023-03-21 23:11:32 +0100 |
|---|---|---|
| committer | Sakarias Johansson <sakariasjohansson@hotmail.com> | 2023-04-05 19:38:04 +0200 |
| commit | b10888e575d757d23cace28c8e12b8ea4ec5c2d0 (patch) | |
| tree | 5c195a707c8dd4556fe992ff59fb6c52dd749f61 /racer-tracer/src/scene_controller | |
| parent | 5b6e06928bbd5466d0c65149e8c7e44871e71a8c (diff) | |
| download | racer-tracer-b10888e575d757d23cace28c8e12b8ea4ec5c2d0.tar.gz racer-tracer-b10888e575d757d23cace28c8e12b8ea4ec5c2d0.tar.xz racer-tracer-b10888e575d757d23cace28c8e12b8ea4ec5c2d0.zip | |
🙃 Tried this, was not worth the performance
Did a test where I removed all the operators for vec and forced the
user to use functions on the vector instead that mutated the existing
vector.
You had to manually call clone if you actually wanted a new vector.
No automatic copies were done. Expected the performace to increase by
quite a bit since most of the operations are vector operations.
Chaining operations like the following just mutated the existing
vector.
```
vec.mul(vec2).div(2).add(vec3);
```
Could do this pattern for most things.
Turns out is's not such a big deal.
Set up a test case of the simple scene with 3 balls. The difference in
performance was about 1%. Got surprised and made a more complex scene with
over 400 objects expecting to get a bigger difference. Nope. Still 1%.
Decided it was not worth it since it was a bit more annoying working
with the vectors.
Probably get better performance gains with SIMD or using the GPU.
Diffstat (limited to 'racer-tracer/src/scene_controller')
0 files changed, 0 insertions, 0 deletions
