buffer,util: refactor for performance · nodejs/node@0c0241f · GitHub
Skip to content

Commit 0c0241f

Browse files
Trottevanlucas
authored andcommitted
buffer,util: refactor for performance
internal/util.js definied toInteger() and toLength() but they were only used by buffer.js. Inlining these small functions results in a small but statistically-significant performance gain. PR-URL: #12153 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 25b851b commit 0c0241f

4 files changed

Lines changed: 8 additions & 87 deletions

File tree

lib/buffer.js

Lines changed: 8 additions & 2 deletions

lib/internal/util.js

Lines changed: 0 additions & 18 deletions

test/parallel/test-internal-util-toInteger.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

test/parallel/test-internal-util-toLength.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)