Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Speeds up static-check from 18.5s to 4.8s for incremental changes (74% improvement).

Changes

  1. Enable parallel-by-default - Add MAKEFLAGS += -j to Makefile

    • Independent checks (lint, typecheck, fmt-check) run concurrently
    • Cold cache: 18.5s → 13s
  2. Enable ESLint caching - Add --cache flag to scripts/lint.sh

    • Caches lint results per file, only re-lints changed files
    • Incremental: 13s → ~1s (only changed files re-linted)

Performance

Scenario Before After Improvement
Cold cache (CI) 18.5s 13s 30% faster
Hot cache (dev) 18.5s 4.8s 74% faster

Implementation Details

Parallel-by-default

  • Added MAKEFLAGS += -j to enable parallel execution by default
  • Updated documentation to reflect new behavior (use -j1 for sequential)
  • Existing .NOTPARALLEL directive for build-main ensures safety where needed

ESLint cache

  • Cache file (.eslintcache) stores lint results keyed by file content
  • Automatically invalidates on ESLint config changes
  • Gitignored to avoid committing cache state

Testing

Verified performance with:

  • Clean cache (simulates CI): Full lint takes 13s
  • Hot cache + small change: Lint takes ~1s (only changed files)
  • Full static-check with hot cache: 4.8s total

Generated with cmux

Speeds up static-check from 18.5s to 4.8s for incremental changes (74% improvement).

**Changes:**

1. **Enable parallel-by-default** - Add MAKEFLAGS += -j to Makefile
   - Independent checks (lint, typecheck, fmt-check, etc.) now run concurrently
   - 18.5s → 13s for cold cache

2. **Enable ESLint caching** - Add --cache flag to scripts/lint.sh
   - Caches lint results per file, only re-lints changed files
   - 13s → ~1s for incremental changes (only changed files re-linted)
   - Cache file (.eslintcache) is gitignored

**Performance:**
- Cold cache (CI): 18.5s → 13s (30% faster)
- Hot cache (dev): 18.5s → 4.8s (74% faster)

**Safety:**
- Targets requiring sequential execution use .NOTPARALLEL (already in place)
- ESLint cache invalidates automatically on config changes
- No change to CI behavior (cache starts empty)

_Generated with `cmux`_
@ammario ammario enabled auto-merge October 17, 2025 02:44
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR.

The previous implementation unconditionally set MAKEFLAGS += -j, which
overrode user-provided -j flags (e.g., make -j1 would still run in parallel).

Now we only default to parallel execution if the user didn't explicitly
provide a -j flag, properly respecting their choice.

_Generated with `cmux`_
@ammario ammario added this pull request to the merge queue Oct 17, 2025
Merged via the queue into main with commit 34e01b9 Oct 17, 2025
8 checks passed
@ammario ammario deleted the opt-static-check branch October 17, 2025 02:59
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