Skip to content

Conversation

@dusrdev
Copy link
Contributor

@dusrdev dusrdev commented Nov 17, 2025

This PR removes an unnecessary Task.Run wrapper from Task returning methods that accept a CancellationToken. The wrapper was redundant because these methods already support WaitAsync directly, and it caused unnecessary thread pool overhead.

The ConsoleAppFramework v5(app with CancellationToken) benchmark (on my machine), shows 1.7X faster execution and 2.2X less memory allocation.

Before the changes:
SCR-20251117-qtgq

After the changes:
SCR-20251117-qtvx

@neuecc
Copy link
Member

neuecc commented Nov 18, 2025

thanks, nice improvement!

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.

2 participants