Yes, it does beat -O3 C sometimes. I took code from diverse 'language speed' benchmarks from the internet and had to rearrange them to get -O3 to beat equivalent-looking JS (Node 25.8.1 w\ V8 14.1 and clang 21 on MBP3).
> What was that code?
literally:
``` function numericKernel(a, b, out, n) {
for (let i = 0; i < n; i += 4) {
out[i] = a[i] * b[i] + 0.25;
out[i + 1] = a[i + 1] * b[i + 1] + 0.25;
out[i + 2] = a[i + 2] * b[i + 2] + 0.25;
out[i + 3] = a[i + 3] * b[i + 3] + 0.25;
}
}
```
i've tried various options, Firefox prefers ` for (let i = n; i--;) out[i] = a[i] * b[i] + 0.25;` Its already at peak optimization so no form is significantly better.