MCPcopy Index your code
hub / github.com/nodejs/node / main

Function main

benchmark/buffers/buffer-equals.js:10–22  ·  view source on GitHub ↗
({ n, size, difflen })

Source from the content-addressed store, hash-verified

8});
9
10function main({ n, size, difflen }) {
11 const b0 = Buffer.alloc(size, 'a');
12 const b1 = Buffer.alloc(size + (difflen === 'true' ? 1 : 0), 'a');
13
14 if (b1.length > 0)
15 b1[b1.length - 1] = 'b'.charCodeAt(0);
16
17 bench.start();
18 for (let i = 0; i < n; i++) {
19 b0.equals(b1);
20 }
21 bench.end(n);
22}

Callers

nothing calls this directly

Calls 4

allocMethod · 0.80
startMethod · 0.45
equalsMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…