mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
* 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>
22 lines
467 B
C#
22 lines
467 B
C#
using BenchmarkDotNet.Attributes;
|
|
using Robust.Shared.Analyzers;
|
|
using Robust.Shared.Maths;
|
|
using Robust.Shared.Physics.Shapes;
|
|
|
|
namespace Robust.Benchmarks.NumericsHelpers;
|
|
|
|
// SlimPolyon is internal, so this won't compile without changes.
|
|
/*
|
|
[Virtual, DisassemblyDiagnoser]
|
|
public class SlimPolygonBenchmark
|
|
{
|
|
public Box2Rotated RotBox = new();
|
|
|
|
[Benchmark]
|
|
public SlimPolygon RotatedBox()
|
|
{
|
|
return new SlimPolygon(in RotBox);
|
|
}
|
|
}
|
|
*/
|