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
{{ message }}
This repository has been archived by the owner on May 3, 2022. It is now read-only.
I'm working on a fat heavy branch and I'm keeping notes of optimizations that we should backport everywhere
use this inside constructors, v8 literally pattern detects for this.foo = x and NOT self.foo =x
use bucket based OutPending() data structure instead of naive dictionary
use write ahead to avoid calling RW.byteLength. buf.write() returns bytes written, and with our offset tracking we can always backtrack and set frame.writeUInt32BE(finalOffset, 0)
use TCP_WRAP if process.version === 0.10.32 to go 30% faster.
use 512kb SlowBuffer pool instead of new Buffer()
use the arg2str or arg2buf trick.
use the caching headers + writeHead() & writeTail() trick.
use utf8slice and utf8write.
avoid reading arg1 as slice when we only need string anyway.
thread offset through frame parsing to avoid SlowBuffer#slice where possible.
Yep; we need to avoid the instanceof pattern in any constructors that are not public interface or any constructors that are O(n) requests or O(n) sockets
We may also need to rethink the instanceof pattern for public interfaces and maybe favor a node-core-style createX() function.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm working on a fat heavy branch and I'm keeping notes of optimizations that we should backport everywhere
this
inside constructors, v8 literally pattern detects forthis.foo = x
and NOTself.foo =x
OutPending()
data structure instead of naive dictionaryRW.byteLength
.buf.write()
returns bytes written, and with our offset tracking we can always backtrack and setframe.writeUInt32BE(finalOffset, 0)
new Buffer()
arg1
as slice when we only need string anyway.cc @jcorbin @rf @kriskowal
The text was updated successfully, but these errors were encountered: