6 Commits

Author SHA1 Message Date
Leon Friedrich
3f19d25018 Box Simd (#6193)
* Box Simd

* Add 256 bit version of GetAABB

* Add AABB bechmarks

* No real diff between 128 & 256, so removing 256

| Method     | Mean      | Error     | StdDev    | Ratio |
|----------- |----------:|----------:|----------:|------:|
| GetAABB    | 5.8107 ns | 0.0154 ns | 0.0137 ns |  1.00 |
| GetAABB128 | 0.4927 ns | 0.0003 ns | 0.0002 ns |  0.08 |
| GetAABB256 | 0.4332 ns | 0.0006 ns | 0.0006 ns |  0.07 |

* Add Box2Rotated.Transform Benchmark

* Results

20% faster and much smaller code. Also I don't think it inlined RotateVec

* Add Matrix3x2Helper.TransformBox() benchmark

new:

| Method    | Mean     | Error     | StdDev    | Code Size |
|---------- |---------:|----------:|----------:|----------:|
| Transform | 2.463 ns | 0.0766 ns | 0.0679 ns |     216 B |

old:
| Method    | Mean     | Error     | StdDev    | Median   | Code Size |
|---------- |---------:|----------:|----------:|---------:|----------:|
| Transform | 9.469 ns | 0.2140 ns | 0.5408 ns | 9.206 ns |     621 B |

* Fix polygon constructor

* SlimPolygonBenchmark

* use new SimdHelper for other methods

* Fix bugs

* Use new methods

* Simd SlimPolygon.ComputeAABB

* Move simd transform to physics

* Cleanup

* Remove uneccesary Unsafe.SkipInit

* These tests all work on master

* Add Transform.MulSimd test

* Add SlimPolygon constructor tests

* Add ComputeAABB test

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
2025-11-10 18:30:08 +11:00
metalgearsloth
7d1ad527d9 Replace Robust Vector2 with System.Numerics (#4092) 2023-07-08 14:08:26 +10:00
Pieter-Jan Briers
a86a539c15 Move to .NET 7 SIMD intrinsics (#3584) 2022-12-18 11:44:57 +01:00
Paul Ritter
2fb64480db benchmark workflow & storing it in db (#2653) 2022-03-29 21:43:32 +02:00
Pieter-Jan Briers
de4d255841 Analyzer to enforce classes to be either [Virtual], abstract, or sealed. (#2469)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
2022-02-05 19:31:58 +01:00
Pieter-Jan Briers
20dae60fd4 Add NumericsHelpers add method. 2021-07-31 16:52:24 +02:00