diff --git a/benchmark/buffers/buffer-iterate.js b/benchmark/buffers/buffer-iterate.js index c1c4f6917501a1..44ea637a28e95a 100644 --- a/benchmark/buffers/buffer-iterate.js +++ b/benchmark/buffers/buffer-iterate.js @@ -1,11 +1,9 @@ 'use strict'; -const SlowBuffer = require('buffer').SlowBuffer; const common = require('../common.js'); const assert = require('assert'); const bench = common.createBenchmark(main, { size: [512, 4096, 16386], - type: ['fast'], method: ['for', 'forOf', 'iterator'], n: [1e3], }); @@ -16,10 +14,8 @@ const methods = { 'iterator': benchIterator, }; -function main({ size, type, method, n }) { - const buffer = type === 'fast' ? - Buffer.alloc(size) : - SlowBuffer(size).fill(0); +function main({ size, method, n }) { + const buffer = Buffer.alloc(size); const fn = methods[method]; diff --git a/benchmark/buffers/buffer-read-with-byteLength.js b/benchmark/buffers/buffer-read-with-byteLength.js index 57e46b8ce4453f..bef09ce4f0d981 100644 --- a/benchmark/buffers/buffer-read-with-byteLength.js +++ b/benchmark/buffers/buffer-read-with-byteLength.js @@ -9,16 +9,13 @@ const types = [ ]; const bench = common.createBenchmark(main, { - buffer: ['fast'], type: types, n: [1e6], byteLength: [1, 2, 3, 4, 5, 6], }); -function main({ n, buf, type, byteLength }) { - const buff = buf === 'fast' ? - Buffer.alloc(8) : - require('buffer').SlowBuffer(8); +function main({ n, type, byteLength }) { + const buff = Buffer.alloc(8); const fn = `read${type}`; buff.writeDoubleLE(0, 0); diff --git a/benchmark/buffers/buffer-read.js b/benchmark/buffers/buffer-read.js index f3b2a5645174fe..67892730ee71cc 100644 --- a/benchmark/buffers/buffer-read.js +++ b/benchmark/buffers/buffer-read.js @@ -19,15 +19,12 @@ const types = [ ]; const bench = common.createBenchmark(main, { - buffer: ['fast'], type: types, n: [1e6], }); -function main({ n, buf, type }) { - const buff = buf === 'fast' ? - Buffer.alloc(8) : - require('buffer').SlowBuffer(8); +function main({ n, type }) { + const buff = Buffer.alloc(8); const fn = `read${type}`; buff.writeDoubleLE(0, 0); diff --git a/benchmark/buffers/buffer-slice.js b/benchmark/buffers/buffer-slice.js index cc6e1a8a1449fc..3b80c4d189fa06 100644 --- a/benchmark/buffers/buffer-slice.js +++ b/benchmark/buffers/buffer-slice.js @@ -1,17 +1,15 @@ 'use strict'; const common = require('../common.js'); -const SlowBuffer = require('buffer').SlowBuffer; const bench = common.createBenchmark(main, { - type: ['fast', 'slow', 'subarray'], + type: ['slice', 'subarray'], n: [1e6], }); const buf = Buffer.allocUnsafe(1024); -const slowBuf = new SlowBuffer(1024); function main({ n, type }) { - const b = type === 'slow' ? slowBuf : buf; + const b = buf const fn = type === 'subarray' ? () => b.subarray(10, 256) : () => b.slice(10, 256); diff --git a/benchmark/buffers/buffer-write.js b/benchmark/buffers/buffer-write.js index 239abc8a0da69e..30475e484dd67d 100644 --- a/benchmark/buffers/buffer-write.js +++ b/benchmark/buffers/buffer-write.js @@ -27,7 +27,6 @@ const types = [ ]; const bench = common.createBenchmark(main, { - buffer: ['fast'], type: types, n: [1e6], }); @@ -70,10 +69,8 @@ const byteLength = { writeIntBE: 6, }; -function main({ n, buf, type }) { - const buff = buf === 'fast' ? - Buffer.alloc(8) : - require('buffer').SlowBuffer(8); +function main({ n, type }) { + const buff = Buffer.alloc(8) const fn = `write${type}`; if (!/\d/.test(fn)) diff --git a/doc/api/buffer.md b/doc/api/buffer.md index fbbcc04083ef51..dbd9520a846131 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -5326,30 +5326,6 @@ console.log(newBuf.toString('ascii')); Because the Euro (`€`) sign is not representable in US-ASCII, it is replaced with `?` in the transcoded `Buffer`. -### Class: `SlowBuffer` - - - -> Stability: 0 - Deprecated: Use [`Buffer.allocUnsafeSlow()`][] instead. - -See [`Buffer.allocUnsafeSlow()`][]. This was never a class in the sense that -the constructor always returned a `Buffer` instance, rather than a `SlowBuffer` -instance. - -#### `new SlowBuffer(size)` - - - -> Stability: 0 - Deprecated: Use [`Buffer.allocUnsafeSlow()`][] instead. - -* `size` {integer} The desired length of the new `SlowBuffer`. - -See [`Buffer.allocUnsafeSlow()`][]. - ### Buffer constants -Automatically zero-fills all newly allocated [`Buffer`][] and [`SlowBuffer`][] -instances. +Automatically zero-fills all newly allocated [`Buffer`][] instances. ## Environment variables @@ -3580,7 +3579,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12 [`CRYPTO_secure_malloc_init`]: https://www.openssl.org/docs/man3.0/man3/CRYPTO_secure_malloc_init.html [`NODE_OPTIONS`]: #node_optionsoptions [`NO_COLOR`]: https://no-color.org -[`SlowBuffer`]: buffer.md#class-slowbuffer [`Web Storage`]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API [`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket [`YoungGenerationSizeFromSemiSpaceSize`]: https://chromium.googlesource.com/v8/v8.git/+/refs/tags/10.3.129/src/heap/heap.cc#328 diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index f10265b9ddd98a..49852acd1ad533 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -691,23 +691,6 @@ Type: End-of-Life `util.error()` has been removed. Please use [`console.error()`][] instead. -### DEP0030: `SlowBuffer` - - - -Type: Documentation-only - -The [`SlowBuffer`][] class is deprecated. Please use -[`Buffer.allocUnsafeSlow(size)`][] instead. - ### DEP0031: `ecdh.setPublicKey()`