Skip to content

ci: compile source-built Rubies with flags that make them run faster - #3245

Merged
solnic merged 1 commit into
masterfrom
ci/optimize-source-built-rubies
Dec 1, 2026
Merged

solnic merged 1 commit into
masterfrom
ci/optimize-source-built-rubies

Conversation

@solnic

@solnic solnic commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Ruby 2.7, 3.0 and 3.1 have no precompiled build, so CI compiles them from source. .mise.ci.toml set RUBY_CFLAGS to an empty string on x86, which replaced Ruby's default -O3. Those Rubies were built with CFLAGS=" -fPIC", effectively -O0, and ran a CPU benchmark about 6.5x slower than the precompiled 3.2+ (3.07s vs 0.47s).

This sets -O3 explicitly in RUBY_CFLAGS.

On sentry-rails, "Run specs" on those Rubies drops 2–3x compared with master. For example, 3.0/7.1 goes from 358s to 125s, and 3.1/7.2 from 781s to 447s.

The mise cache key covers .mise*.toml, so the first run recompiles the three Rubies once (about 9 min in setup-mise).

@solnic
solnic force-pushed the ci/optimize-source-built-rubies branch from 3881cd5 to 6e38384 Compare November 25, 2026 11:56
@solnic
solnic added this pull request to stack #3246 November 25, 2026 11:56
@solnic
solnic force-pushed the ci/optimize-source-built-rubies branch from 6a3a2f8 to 6e38384 Compare November 25, 2026 12:25
@solnic
solnic removed this pull request from stack #3246 November 25, 2026 12:33
@solnic
solnic added this pull request to stack #3248 November 25, 2026 12:33
@solnic
solnic marked this pull request as ready for review November 25, 2026 13:42
@solnic
solnic requested a review from a team as a code owner November 25, 2026 13:42
@solnic
solnic force-pushed the ci/optimize-source-built-rubies branch from 6e38384 to 6b2e0f6 Compare November 30, 2026 13:35
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit 6b2e0f6.

The model rated this change low. It was raised to medium because:

  • R6: build or release configuration changed: .mise.ci.toml
  • R7: the model was not confident enough that the change is low

This label is a hint for reviewers, not an approval.

@solnic
solnic merged commit 3c41404 into master Dec 1, 2026
172 checks passed
@solnic
solnic deleted the ci/optimize-source-built-rubies branch December 1, 2026 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants