Skip to content

Revert "Add a workaround for slow BigDecimal#to_f when it has large N_significant_digits"#522

Merged
tompng merged 1 commit intoruby:masterfrom
tompng:revert_to_f_workaround
Apr 8, 2026
Merged

Revert "Add a workaround for slow BigDecimal#to_f when it has large N_significant_digits"#522
tompng merged 1 commit intoruby:masterfrom
tompng:revert_to_f_workaround

Conversation

@tompng
Copy link
Copy Markdown
Member

@tompng tompng commented Apr 8, 2026

This reverts commit 3bf735f.

BigDecimal#to_s for large n_significant_digits number became about 10 times fast.
huge_n_significant_digit_number.to_f is still not fast. It takes O(N) time although we only need first 16-digit for BigMath use-case, but to_f is no longer a bottleneck of BigMath and its test execution time anymore.

@tompng tompng force-pushed the revert_to_f_workaround branch from eb1a3c7 to 88851b3 Compare April 8, 2026 13:04
@tompng tompng merged commit fc54487 into ruby:master Apr 8, 2026
84 checks passed
@tompng tompng deleted the revert_to_f_workaround branch April 8, 2026 13:44
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