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

Use Queue instead of ConcurrentQueue in single-threaded thread pool #111245

Merged
merged 12 commits into from
Jan 20, 2025

Conversation

pavelsavara
Copy link
Member

@pavelsavara pavelsavara commented Jan 9, 2025

Motivation: performance and size improvements for single-threaded WASM

  • introduce FEATURE_SINGLE_THREAD define symbol
  • use Queue instead of ConcurrentQueue in single-threaded thread pool
  • make ThreadPoolTypedWorkItemQueue #if TARGET_WINDOWS and non-generic

- use Queue instead of ConcurrentQueue in single-threaded thread pool
- protect ConcurrentQueue ctor from trimming when used with `JsonSerializer.Deserialize`
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-VM-threading-mono size-reduction Issues impacting final app size primary for size sensitive workloads labels Jan 9, 2025
@pavelsavara pavelsavara added this to the 10.0.0 milestone Jan 9, 2025
@pavelsavara pavelsavara self-assigned this Jan 9, 2025
@pavelsavara pavelsavara changed the title [browser][ST] Use Queue instead of ConcurrentQueue in single-threaded thread pool [WASM][ST] Use Queue instead of ConcurrentQueue in single-threaded thread pool Jan 9, 2025
@pavelsavara pavelsavara marked this pull request as ready for review January 16, 2025 20:34
@pavelsavara pavelsavara changed the title [WASM][ST] Use Queue instead of ConcurrentQueue in single-threaded thread pool Use Queue instead of ConcurrentQueue in single-threaded thread pool Jan 20, 2025
@pavelsavara pavelsavara merged commit 8c4c381 into dotnet:main Jan 20, 2025
138 of 140 checks passed
@pavelsavara pavelsavara deleted the browser_trim_st_concurrent_queue branch January 20, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-VM-threading-mono size-reduction Issues impacting final app size primary for size sensitive workloads
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants