Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Chrome 138
Linux
Desktop
10 months ago
Test name Executions per second
Classic 16 1761188.1 Ops/sec
Mul shf 16 1704603.4 Ops/sec
Imul shf 16 1730111.9 Ops/sec
Classic 32 1740014.1 Ops/sec
Mul shf bigint 1542291.8 Ops/sec
Mul shf 32 782950.2 Ops/sec
java nextInt16(bound) 1712716.6 Ops/sec
java nextInt32(bound) 1717743.5 Ops/sec
Script Preparation code:
Tests:
  • Classic 16

  • Mul shf 16

  • Imul shf 16

  • Classic int

  • Mul shf bigint

  • Mul shf 32

  • java nextInt16(bound)

  • java nextInt32(bound)