EnchantmentCracker
EnchantmentCracker copied to clipboard
Pre-compute values to speed up first search
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:
- Added explicit next8 and next8and16 functions to SimpleRandom, which skips having to check if the input is a power of 2.
- Acceptable values for the results of randomness are worked out before the core loop, changing the entire logic to just 3 lookups.
Changes made.
Changes made.
you didn't mark it as changed lol