Skip to content

Conversation

@roflmuffin
Copy link
Owner

@roflmuffin roflmuffin commented Dec 18, 2025

Move NextFrame queue to managed .NET side

During extensive testing of NextFrame and related scheduling code, I benchmarked using a .NET ConcurrentQueue<T> instead of the current C++ concurrent queue implementation.

Results

  • Native C++ approach: Queuing and resolving 100,000 NextFrame tasks took ~300ms on average (mainly due to P/Invoke overhead & FunctionReference memory allocations)
  • Managed .NET approach: The same workload completed in 5–20ms (variance depends on where in the frame the benchmark was queued)

This is roughly a 50x improvement by moving the queue storage to the .NET side and having a managed listener drain the queue each frame.

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