x*x vs sqrt with Math.powFastest: x*x (2.0x faster)
22,637 ops/sec
11,408 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| x*x | |
| sqrt with Math.pow |
| Test name | Executions per second |
|---|---|
| ✓ x*x | 21,230 Ops/sec |
| sqrt with Math.pow | 8,249 Ops/sec |