Skip to content

Explore parallelisation for build#167

Open
eelcoj wants to merge 1 commit intomainfrom
build-goes-brrrr
Open

Explore parallelisation for build#167
eelcoj wants to merge 1 commit intomainfrom
build-goes-brrrr

Conversation

@eelcoj
Copy link
Copy Markdown
Contributor

@eelcoj eelcoj commented Mar 18, 2026

The build process is bottlenecked by sequential page rendering. Each page is currently rendered linear (one-by-one).

Using the parallel gem, you can allow multiple pages to be rendered concurrently. 🍾

The number of threads is auto-detected based on CPU cores via the parallel gem (can be configured via Perron.config.build_threads: name TBD).

Some stats 📈

Site Pages Sequential Parallel Improvement
Perron docs 95 ~9s ~5s ~45%
Rails Designer 483 ~33s ~23s ~30%

Benchmark (Rails Designer site, 483 pages):

Page rendering (sequential): 27.06s
Page rendering (parallel):   18.71s

If you have a medum plus-sized site (500+ pages), do add config.parallel_rendering = true to the Peron initializer to enable parallel rendering (it is off/false by default)

Some notes:

  • Thread-safety: Rails controllers are thread-safe (no shared mutable state during page rendering)
  • Warm runs: Improvements are most visible with cached assets (typical production scenario)

@eelcoj
Copy link
Copy Markdown
Contributor Author

eelcoj commented Mar 18, 2026

Failing CI expected; did not add parallel to the appraised gemfiles.

If someone is willing to share their benchmarks using this branch in the comments. ❤️

Am wondering if this PR can make a difference or if this approach is not right (am not too familiar with the internals of the the parallel gem—and in general this matter.

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.

1 participant