Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Chrome 137
Windows
Desktop
10 months ago
Test name Executions per second
Classic 16 2995248.0 Ops/sec
Mul shf 16 3100184.0 Ops/sec
Imul shf 16 2882384.0 Ops/sec
Classic int 2835602.2 Ops/sec
Mul shf bigint 2077877.2 Ops/sec
Mul shf 32 1347720.2 Ops/sec
java nextInt16(bound) 2913411.8 Ops/sec
java nextInt32(bound) 3070167.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)