Skip to content

Faster buffer slice using subarray()

src: use subarray() in Buffer.slice() for speedup src: throw on out-of-range args in Buffer.slice

Only changed tests that passed out-of-range args

buffers/buffer-slice.js type=fast n=1024: ./node: 4201.9 ./node_slow: 2941.8 . 42.84%
buffers/buffer-slice.js type=slow n=1024: ./node: 4159.2 ./node_slow: 2957 ... 40.66%

buffers/buffer-creation.js type=fast len=10 n=1024: ./node: 3875.3 ./node_slow: 3094.6 .. 25.23%
buffers/buffer-creation.js type=fast len=1024 n=1024: ./node: 2061 ./node_slow: 1810.4 .. 13.84%

Merge request reports

Loading