Skip to content

factor: benchmark the numbers that stress factorization - #14793

Merged
sylvestre merged 1 commit into
uutils:mainfrom
sylvestre:factor-bench
Sep 22, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
sylvestre:factor-bench

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

Products of several primes of similar, moderate size are where a factorization regression shows up first: trial division finds nothing, Pollard's rho has to run for a while before it splits anything, and any O(n^(1/4)) fallback never finishes. The prime power is there because rho cannot split p^k at all, so a regression in the perfect-power check is a hang rather than a slowdown, and the Mersenne prime is all primality testing and no factoring.

Sample counts are capped so the group takes about fifteen seconds rather than several minutes.

should be improved by uutils/num-prime#114

Copilot AI lite review requested due to automatic review settings September 21, 2026 20:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

* src/uu/factor/benches/factor_bench.rs (hard): New module.

Products of several primes of similar, moderate size are where a
factorization regression shows up first: trial division finds nothing,
Pollard's rho has to run for a while before it splits anything, and any
O(n^(1/4)) fallback never finishes. The prime power is there because rho
cannot split p^k at all, so a regression in the perfect-power check is a
hang rather than a slowdown, and the Mersenne prime is all primality
testing and no factoring.

Sample counts are capped so the group takes about fifteen seconds rather
than several minutes.
Copilot AI review requested due to automatic review settings September 22, 2026 12:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codspeed

codspeed Bot commented Sep 22, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚡ 1 improved benchmark
❌ 1 regressed benchmark
🆕 12 new benchmarks
⏩ 430 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation factor_multiple_u64s[2] 68 ms 70.2 ms -3.17%
Memory factor_multiple_u64s[2] 90.8 KB 5.6 KB ×16
🆕 Simulation a_1279_bit_prime N/A 56.4 ms N/A
🆕 Simulation a_prime_to_the_seventh N/A 721.3 µs N/A
🆕 Simulation five_38_bit_primes N/A 1.6 s N/A
🆕 Simulation small_factors_and_a_large_prime N/A 1.2 ms N/A
🆕 Simulation thirteen_39_bit_primes N/A 9.7 s N/A
🆕 Simulation three_39_bit_primes N/A 263.1 ms N/A
🆕 Memory a_1279_bit_prime N/A 19.1 KB N/A
🆕 Memory a_prime_to_the_seventh N/A 15 KB N/A
🆕 Memory five_38_bit_primes N/A 22.1 KB N/A
🆕 Memory small_factors_and_a_large_prime N/A 100.6 KB N/A
🆕 Memory thirteen_39_bit_primes N/A 22.4 KB N/A
🆕 Memory three_39_bit_primes N/A 13.6 KB N/A

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing sylvestre:factor-bench (ae3e119) with main (0149247)2

Open in CodSpeed

Footnotes

  1. 430 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (240ce3b) during the generation of this report, so 0149247 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@github-actions

Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)

@sylvestre
sylvestre merged commit 9087d23 into uutils:main Sep 22, 2026
98 of 99 checks passed
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