Skip to content

C#: Implement object pools for Array, Dictionary, StringName, NodePath #106122

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

beicause
Copy link
Contributor

@beicause beicause commented May 6, 2025

Implement godotengine/godot-proposals#12375

Benchmark the performance of GetTree().GetNodesInGroup(cached_sn) cs-object-pools-alloc.zip
This PR:

// * Summary *

BenchmarkDotNet v0.14.0, EndeavourOS
AMD Ryzen 7 4800U with Radeon Graphics, 1 CPU, 16 logical and 8 physical cores
.NET SDK 9.0.105
  [Host] : .NET 9.0.4 (9.0.425.16305), X64 RyuJIT AVX2

Toolchain=InGodotProcessNoEmitToolchain

| Method     | Mean      | Error    | StdDev   | Gen0      | Gen1      | Allocated |
|----------- |----------:|---------:|---------:|----------:|----------:|----------:|
| Base       | 140.20 ms | 2.563 ms | 6.040 ms | 1750.0000 | 1500.0000 |  11.44 MB |
| ReturnPool |  79.55 ms | 0.958 ms | 0.896 ms | 3000.0000 |         - |    6.1 MB |

Master:


BenchmarkDotNet v0.14.0, EndeavourOS
AMD Ryzen 7 4800U with Radeon Graphics, 1 CPU, 16 logical and 8 physical cores
.NET SDK 9.0.105
  [Host] : .NET 9.0.4 (9.0.425.16305), X64 RyuJIT AVX2

Toolchain=InGodotProcessNoEmitToolchain  

| Method | Mean     | Error   | StdDev  | Gen0      | Gen1      | Allocated |
|------- |---------:|--------:|--------:|----------:|----------:|----------:|
| Base   | 152.9 ms | 3.03 ms | 4.80 ms | 1750.0000 | 1500.0000 |  11.44 MB |

@AThousandShips AThousandShips added this to the 4.x milestone May 6, 2025
@beicause beicause force-pushed the cs-object-pools branch 5 times, most recently from 6f8489f to 011bd83 Compare May 8, 2025 05:44
@beicause beicause force-pushed the cs-object-pools branch from 011bd83 to 512fbfa Compare May 8, 2025 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants