Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add configurable concurrency option#1176

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
jakebailey wants to merge13 commits intomain
base:main
Choose a base branch
Loading
fromjabaile/concurrency-options

Conversation

jakebailey
Copy link
Member

@jakebaileyjakebailey commentedJun 12, 2025
edited
Loading

This adds an experimental--concurrency flag. Example usage:

  • --concurrency <default|auto|on|yes> - default behavior, uses 4 checkers, plus all cores for parse/bind/emit. Theoretically we could change this to some magic algorithm.
  • --concurrency <single|off|no>,--singleThreaded - one checker, single threaded parse/bind/emit.
  • --concurrency max - UsesGOMAXPROCS checkers, plus all cores for parse/bind/emit.
  • --concurrency half - UsesGOMAXPROCS/2 checkers, plus all cores for parse/bind/emit. (For me, this option is best for checking VS Code.)
  • --concurrency 10 - Uses 10 checkers, plus all cores for parse/bind/emit. Can be any number all the way up to the number of files.
  • For testing,--concurrency checker-per-file creates a checker for every file; max concurrency, for testing race conditions.

Maybe this is overkill, I can drop some of this.

@CopilotCopilotAI review requested due to automatic review settingsJune 12, 2025 23:38
Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Pull Request Overview

This PR introduces a configurable concurrency option, replacing the old single-threaded testing flag with a new --concurrency flag that allows detailed control over the number of checkers and threads used during compilation. Key changes include:

  • Adding a new "concurrency" field to compiler options and command line declarations.
  • Creating a new core package for parsing and handling concurrency values.
  • Updating test utilities, the compiler runner, and CI configurations to support the new flag.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
FileDescription
internal/tsoptions/parsinghelpers.goAdded parsing for "concurrency" flag in compiler options.
internal/tsoptions/declscompiler.goDeclared the new "concurrency" option for the compiler.
internal/testutil/harnessutil/harnessutil.goSet default concurrency from environment if not provided via flag.
internal/testrunner/compiler_runner.goUpdated concurrency condition for skipping error baselines.
internal/core/concurrency.goIntroduced parsing logic and tests for various concurrency values.
internal/compiler/program.goUpdated program initialization to use new concurrency settings.
Herebyfile.mjsUpdated environment variable usage to use "concurrency" instead of the old flag.
.github/workflows/ci.ymlUpdated environment variable in CI to support the new concurrency flag.

@jakebaileyjakebaileyforce-pushed thejabaile/concurrency-options branch from5eb5b31 to99fc50cCompareJune 12, 2025 23:42
@DanielRosenwasser
Copy link
Member

Instead ofconcurrency, I would recommendcheckConcurrency.

@jakebailey
Copy link
MemberAuthor

Except that this also controls the concurrency of the parse/bind/emit stages too... I wasn't happy with any name I came up with.

@jakebaileyjakebailey marked this pull request as draftJune 19, 2025 05:46
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@jakebailey@DanielRosenwasser

[8]ページ先頭

©2009-2025 Movatter.jp