You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimize CodedBufferWriter._copyInto to memcpy (#885)
dart2wasm currently can't optimize loops into memcpy, however `setRange`
methods have type tests to generate `array.copy` (Wasm's `memcpy`).
Replacing the loops in `CodedBufferWriter._copyInto` with `setRange` improves
an internal benchmark extracted from a real use case significantly in all
targets:
| | Before | After | Diff |
|------------------------------|------------|------------|---------------------|
| AOT | 127,587 us | 95,634 us | -31,953 us, -25.0% |
| JIT | 106,880 us | 92,800 us | -14,080 us, -13.1% |
| dart2js -O4 | 285,587 us | 262,222 us | -23,365 us, -8.1% |
| dart2wasm --omit-type-checks | 337,000 us | 236,100 us | -100,900 us, -29.9% |
0 commit comments