Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized divisionless implementation of minstd #5256

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mirounga
Copy link

@mirounga mirounga commented Jan 27, 2025

I have traced the optimization to the following paper:

Carta, David F. "Two fast implementations of the “minimal standard” random number generator." Communications of the ACM 33, no. 1 (1990): 87-88.

BEFORE:

Benchmark Time CPU Iterations

BM_lcg 4.44 ns 4.45 ns 154482759

AFTER:

Benchmark Time CPU Iterations

BM_lcg 2.09 ns 2.09 ns 344615385

Double the speed

@mirounga mirounga requested a review from a team as a code owner January 27, 2025 21:03
@StephanTLavavej StephanTLavavej added the performance Must go faster label Jan 27, 2025
stl/inc/random Outdated Show resolved Hide resolved
stl/inc/random Outdated Show resolved Hide resolved
stl/inc/random Show resolved Hide resolved
@StephanTLavavej StephanTLavavej self-assigned this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
Status: Initial Review
Development

Successfully merging this pull request may close these issues.

2 participants