
Research
Node.js Fixes AsyncLocalStorage Crash Bug That Could Take Down Production Servers
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.
A highly-efficient simple (no frills) object pool.
deePool (aka "deep-pool") is an object pool with efficiency (speed, low memory, little-to-no GC) as its primary design goal.
As such, there are no configuration options to tweak behavior. It does one thing, and one thing well. If you want to re-configure the behavior, modify the code. :)
Also, this library doesn't really try to do much in the way of graceful handling of errors or mistakes, as that stuff just slows it down. You should be careful in how you use deePool.
This library uses ES6+ features. If you need to support ES<=5 environments, transpile it first (with Babel, etc).
There's only one method on the main module API:
deePool.create( objectFactory )
create(..): produces a new pool instance. You can create as many separate pools as you need. You can even create a pool whose objects are themselves pools.
objectFactory must be a function that produces a single new empty object (or array, etc) that you want available in the pool. Examples:
var myArrays = deePool.create( function makeArray(){
return [
[ "foo", "bar", "baz" ],
[ 1, 2, 3 ]
];
} );
var myWidgets = deePool.create( function makeWidgets(){
return new SomeCoolWidget(1,2,3);
} );
Each pool instance has four simple methods on its API:
pool.use()
pool.recycle( obj )
pool.grow( additionalSize [ = currentSize ] )
pool.size()
pool.use(): retrieves an available object instance from the pool. Example:
var arr = myArrays.use();
Note: If the pool doesn't have any free instances, it will automatically grow (double in size, or set initially to 5 if currently empty) and then return one of the new instances.
pool.recycle(..): inserts an object instance back into the pool for later reuse. Example:
myArrays.recycle( arr );
Tips:
recycle(..) object instances after you're done using them. They are not automatically recycled; if you don't recycle, the pool will run out of available instances and keep growing unboundedly.recycle(..) an object instance until you're fully done with it. As objects are held by reference in JS, if you hold onto a reference and modify an already recycled object, you will cause difficult to track down bugs in your application! To avoid this pitfall, unset your reference(s) to a pooled object immediately after recycle(..)ing it.recycle(..) objects that weren't created for the pool and extracted by a previous use().recycle(..) an object more than once. This will end up creating multiple references in the pool to the same object, which will cause difficult to track down bugs in your application! To avoid this pitfall, unset your reference(s) to a pooled object immediately after recycle(..).recycle(..). If a pooled object holds references to other objects, and you want that memory freed up, make sure to unset those references.Note: If you insert an object instance into a pool that has no empty slots (this is always a mistake, but is not disallowed!), the pool will grow in size by 1 to make room for the inserted object.
pool.grow(..): An optional number passed will specify how many instances to add to the pool (each created by the objectFactory() function specified in the deePool.create(..) call).
If no number is passed, the default is the current size of the pool (doubling it in size). grow(..) returns the new size of the pool. Examples:
var myPool = deePool.create(makeArray);
var arr = myPool.use(); // pool size now `5`
myPool.grow( 3 ); // pool size now `8`
myPool.grow(); // pool size now `16`
var size = myPool.grow( 5 );
size; // 21
Tips:
A new pool starts out empty (size: 0). Always call grow(..) with a valid positive (non-zero) number to initialize the pool before using it. Otherwise, the call will have no effect; on an empty pool, this will confusingly leave the pool empty.
An appropriate initial size for the pool will depend on the tasks you are performing; essentially, how many objects will you need to use concurrently?
You should profile for this with your use-case(s) to determine what the most likely maximum pool size is. You'll want a pool size that's big enough so it doesn't have to grow very often, but not so big that it wastes memory.
Don't grow the pool manually unless you are sure you know what you're doing. It's usually better to set the pool size initially and let it grow automatically (via use()) only as it needs to.
pool.size(): Returns the number of overall slots in the pool (both used and unused). Example:
var myPool = deePool.create(makeArray);
myPool.size(); // 0
myPool.grow(5);
myPool.grow(10);
myPool.grow(5);
var item1 = myPool.use();
var item2 = myPool.use();
myPool.size(); // 20
The distribution library file (deePool.js) can be built (minified) with an included utility. Note: Minification is currently disabled.
With npm, run:
npm run build-core
Or, manually:
node build-core.js
The build utility expects Node.js version 6+.
To run the performance benchmarks, you must first build the core library.
With npm, run:
npm run perfs
Or, manually:
node node-perfs.js
The performance benchmark utility expects Node.js version 6+.
You can also run the performance benchmarks in your browser by opening up perfs.html (requires ES6+ environment).
To run the tests, you must first build the core library.
With npm, run:
npm test
Or, manually:
node node-tests.js
The unit test utility expects Node.js version 6+.
You can also run the tests in your browser by opening up tests.html (requires ES6+ environment).
The code and all the documentation are released under the MIT license.
FAQs
deePool: highly-efficient pool for objects
The npm package deepool receives a total of 110 weekly downloads. As such, deepool popularity was classified as not popular.
We found that deepool demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.