lib: use freelist for WriteWrap instances
WriteWrap
JS objects can be re-used across writes, since the
associated C++ objects are created and destroyed independently
from the JS ones.
Since the WriteWrap
JS constructor calls into C++, re-using the JS
objects instead of creating new ones leads to a minor
performance improvement.
At 500 runs:
confidence improvement accuracy (*) (**) (***)
net/net-c2s.js dur=5 type='buf' len=64 *** 1.59 % ±0.43% ±0.57% ±0.73%
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines