GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — buffer: increase Buffer.poolSize default to 64 KiB · nodejs/node@d3ef412

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • buffer.md
  • lib
    • buffer.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/buffer.md‎

Copy file name to clipboardExpand all lines: doc/api/buffer.md
+6-2Lines changed: 6 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ _may contain sensitive data_. Use [`buf.fill(0)`][`buf.fill()`] to initialize
881881
such `Buffer` instances with zeroes.
882882

883883
When using [`Buffer.allocUnsafe()`][] to allocate new `Buffer` instances,
884-
allocations less than `Buffer.poolSize >>> 1` (4KiB when default poolSize is used) are sliced
884+
allocations less than `Buffer.poolSize >>> 1` (32KiB when default poolSize is used) are sliced
885885
from a single pre-allocated `Buffer`. This allows applications to avoid the
886886
garbage collection overhead of creating many individually allocated `Buffer`
887887
instances. This approach improves both performance and memory usage by
@@ -1513,9 +1513,13 @@ console.log(Buffer.isEncoding(''));
15131513

15141514
<!-- YAML
15151515
added: v0.11.3
1516+
changes:
1517+
- version: REPLACEME
1518+
pr-url: https://github.com/nodejs/node/pull/63597
1519+
description: Default raised from 8192 to 65536.
15161520
-->
15171521

1518-
* Type: {integer} **Default:** `8192`
1522+
* Type: {integer} **Default:** `65536`
15191523

15201524
This is the size (in bytes) of pre-allocated internal `Buffer` instances used
15211525
for pooling. This value may be modified.
Collapse file

‎lib/buffer.js‎

Copy file name to clipboardExpand all lines: lib/buffer.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const constants = ObjectDefineProperties({}, {
171171
},
172172
});
173173

174-
Buffer.poolSize = 8 * 1024;
174+
Buffer.poolSize = 64 * 1024;
175175
let poolSize, poolOffset, allocPool, allocBuffer;
176176

177177
function createPool() {

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.