Commit Graph
10 Commits
Author SHA1 Message Date
metalgearslothandGitHub bc55ae00d6 Box2 + Box2Rotated performance and fixes (#6668) 2026-08-01 15:30:41 +10:00
metalgearslothandGitHub fcf255e11f Make Box2Rotated Transform faster (#34) 2026-06-20 00:51:43 +10:00
metalgearsloth dc7bb35cab Make Box2.Contains faster
Turns out being fancy is slower at least on my machine.
2026-06-19 10:00:05 +10:00
740c562ca3 Import tensors and add methods to sbox (#6450)
* Import tensors and add methods to sbox

* might be a good idea to expose pseudo-ctors
also nuke spans as tey're too much to review rn

* nuke buffers

* nuke unconsumable types

* hilarious

---------

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2026-05-08 11:57:19 +02:00
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
metalgearslothandGitHub 7d1ad527d9 Replace Robust Vector2 with System.Numerics (#4092) 2023-07-08 14:08:26 +10:00
Pieter-Jan BriersandGitHub a86a539c15 Move to .NET 7 SIMD intrinsics (#3584) 2022-12-18 11:44:57 +01:00
Paul RitterandGitHub 2fb64480db benchmark workflow & storing it in db (#2653) 2022-03-29 21:43:32 +02:00
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