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

Pre-compute values to speed up first search #255

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

Conversation

Hexicube
Copy link
Contributor

On my system (i5 8600k) I get the following times for 5 runs using test data 15/7/13/30:
Old: 5.74s 5.41s 4.89s 5.04s 5.03s
New: 5.04s 4.73s 4.00s 3.97s 3.99s
Fastest times after 2 runs is likely due to JIT compilation, I did not restart the cracker between runs.

This is likely far more pronounced on slower systems.

Contains two changes:

  1. Added explicit next8 and next8and16 functions to SimpleRandom, which skips having to check if the input is a power of 2.
  2. Acceptable values for the results of randomness are worked out before the core loop, changing the entire logic to just 3 lookups.

src/enchcracker/SimpleRandom.java Outdated Show resolved Hide resolved
src/enchcracker/SimpleRandom.java Outdated Show resolved Hide resolved
@Hexicube
Copy link
Contributor Author

Changes made.

@HyperCodec
Copy link

Changes made.

you didn't mark it as changed lol

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.

3 participants