EnchantmentCracker icon indicating copy to clipboard operation
EnchantmentCracker copied to clipboard

Pre-compute values to speed up first search

Open Hexicube opened this issue 4 years ago • 2 comments

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.

Hexicube avatar Mar 27 '21 10:03 Hexicube

Changes made.

Hexicube avatar Mar 27 '21 12:03 Hexicube

Changes made.

you didn't mark it as changed lol

HyperCodec avatar Nov 23 '21 20:11 HyperCodec