Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Firefox 140
Linux
Desktop
10 months ago
Test name Executions per second
Classic 16 1871411.1 Ops/sec
Mul shf 16 1633757.9 Ops/sec
Imul shf 16 1581986.5 Ops/sec
Classic 32 1498301.9 Ops/sec
Mul shf bigint 1221841.9 Ops/sec
Mul shf 32 684112.1 Ops/sec
java nextInt16(bound) 1871917.0 Ops/sec
java nextInt32(bound) 1694509.2 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)