Skip to content

Conversation

@ysbaddaden
Copy link
Contributor

Since the concurrent context doesn't exhibit any performance improvement over the parallel context (see #16135) and that we can resize a parallel context (see #15956), we can make the default execution context parallel and set the parallelism to 1 (aka MT:1) by default.

By default the parallelism would be disabled and the execution context remain concurrent only, which is backward compatible (nothing changes).

Resizing the context to enable parallelism will be at the discretion of the application: it can keep using the CRYSTAL_WORKERS environment variable, and/or fallback to the number of CPUs or use a hardcoded value, and/or provide a command line argument, or anything else.

@ysbaddaden ysbaddaden force-pushed the feature/default-context-is-now-parallel-1 branch from 2d59b47 to 99a9e51 Compare September 5, 2025 14:17
Co-authored-by: Johannes Müller <[email protected]>
@straight-shoota straight-shoota added this to the 1.18.0 milestone Sep 13, 2025
@straight-shoota straight-shoota merged commit ab68668 into crystal-lang:master Sep 15, 2025
39 checks passed
@github-project-automation github-project-automation bot moved this from Review to Done in Multi-threading Sep 15, 2025
@ysbaddaden ysbaddaden deleted the feature/default-context-is-now-parallel-1 branch September 15, 2025 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants