Skip to content

Conversation

@dmtrshat
Copy link
Member

Grimoire CSS is already the fastest solution; this work makes it even faster and more efficient, with a safe default and opt-in scaling for multi-core machines.

Overview:

  • Improved end-to-end build performance while keeping generated CSS output unchanged.
  • Added opt-in parallelism for the build pipeline via GRIMOIRE_CSS_JOBS (defaults to current single-thread behavior).
  • Reduced redundant work in the pipeline (fewer repeated passes / less duplicated processing) to improve throughput.
  • Lowered allocation/clone pressure in hot paths to reduce CPU time and stabilize memory usage.
  • Updated benchmark to track performance deltas and make regressions more visible.

Improvements:

  • Wall-time: ~2.68× faster.
  • Peak Memory Usage: ~1.37× lower.
  • Processing Speed: ~2.68x higher.
  • Memory Efficiency: 1.37x higher.

Scaling improves with GRIMOIRE_CSS_JOBS > 1 (best value depends on CPU cores and input size).


closes #100

- Add project-level parallel builds via GRIMOIRE_CSS_JOBS (default 1 = sequential)
- Avoid redundant optimization passes; reduce allocations in parsing/spell pipeline
- Keep correctness: preserve dedup semantics and add regression coverage
- Docs: describe GRIMOIRE_CSS_JOBS and time/peak-memory trade-offs
@dmtrshat dmtrshat merged commit e0252f7 into rc/1.7.0 Dec 27, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Backlog to On RC in Grimoire CSS Dec 27, 2025
@dmtrshat dmtrshat moved this from On RC to Done in Grimoire CSS Dec 27, 2025
@dmtrshat dmtrshat deleted the feature/#100-performance-improvements branch December 27, 2025 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Performance improvements: reduce redundant work, lower allocations, opt-in parallelism

2 participants