Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break up Buffer#toString() into a fast and slow path. The fast path optimizes for zero-length buffers and no-arg method invocation. The speedup for zero-length buffers is a satisfying 700%. The no-arg toString() operation gets faster by about 13% for a one-byte buffer. This change exploits the fact that most Buffer#toString() calls are plain no-arg method calls. Rewriting the method to take no arguments means a call doesn't go through an ArgumentsAdaptorTrampoline stack frame in the common case. PR-URL: #2027 Reviewed-By: Brian White <[email protected]> Reviewed-By: Christian Tellnes <[email protected]> Reviewed-By: Daniel Cousens <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Trevor Norris <[email protected]>
- Loading branch information