Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmark for archetype indexing by handle vs array access vs field direct access #3801

Merged
merged 4 commits into from
Mar 11, 2023

Conversation

DrSmugleaf
Copy link
Member

BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19045
AMD Ryzen 9 7900X, 1 CPU, 24 logical and 12 physical cores
.NET Core SDK=7.0.101
  [Host]     : .NET Core 7.0.1 (CoreCLR 7.0.122.56804, CoreFX 7.0.122.56804), X64 RyuJIT
  DefaultJob : .NET Core 7.0.1 (CoreCLR 7.0.122.56804, CoreFX 7.0.122.56804), X64 RyuJIT


|          Method |     Array | Element | Handle |     Mean |     Error |    StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
|---------------- |---------- |-------- |------- |---------:|----------:|----------:|------:|------:|------:|----------:|
| GetArrayElement | Int32[10] |       5 |    500 | 3.088 ns | 0.0164 ns | 0.0154 ns |     - |     - |     - |         - |
|     GetExisting | Int32[10] |       5 |    500 | 3.060 ns | 0.0234 ns | 0.0208 ns |     - |     - |     - |         - |
|    GetArchetype | Int32[10] |       5 |    500 | 3.478 ns | 0.0159 ns | 0.0148 ns |     - |     - |     - |         - 

@DrSmugleaf DrSmugleaf merged commit 52ba22f into space-wizards:master Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant