performance-helpers 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/package.json +146 -1
- package/src/index.js +1 -0
- package/.eslintrc.cjs +0 -22
- package/.nojekyll +0 -0
- package/.prettierrc +0 -6
- package/CONTRIBUTING.md +0 -178
- package/assets/1_Caching.md +0 -4
- package/assets/2_Parallelizing.md +0 -18
- package/assets/3_Logging.md +0 -3
- package/assets/404.md +0 -3
- package/assets/4_Utils.md +0 -10
- package/assets/logo.png +0 -0
- package/assets/navigation.md +0 -10
- package/bench/README.md +0 -97
- package/bench/results.json +0 -94
- package/bench/results.md +0 -233
- package/bench/run.js +0 -2639
- package/bench/worker.js +0 -43
- package/docs/README.md +0 -38
- package/docs/docs-typedoc.json +0 -38714
- package/docs/helpers/constants/README.md +0 -34
- package/docs/helpers/constants/variables/DEFAULT_AUTOSCALE_BACKOFF_MAX_MULTIPLIER.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_AUTOSCALE_COOLDOWN_MS.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_AUTOSCALE_INTERVAL_MS.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_AUTOSCALE_MIN_INTERVAL_MS.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_BACKPRESSURE_QUEUE_CAPACITY.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_BACKPRESSURE_REFILL_INTERVAL_MS.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_BATCH_MAX_SIZE.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_CACHE_DEFAULT_TTL_MS.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_CACHE_MAX_POOL_SIZE.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_CACHE_MAX_WEIGHT_BYTES.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_HISTOGRAM_BUCKET_COUNT.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_HISTOGRAM_MAX_VALUE.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_MAX_CLEANUP_PER_TICK.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_QUEUE_CAPACITY.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_REAPER_MIN_INTERVAL_MS.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_REFILL_INTERVAL_MS.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_RETRY_BASE_DELAY_MS.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_RETRY_MAX_DELAY_MS.md +0 -9
- package/docs/helpers/constants/variables/DEFAULT_TIMEOUT_MS.md +0 -9
- package/docs/helpers/constants/variables/ENCODE_CACHE_LARGE_KEY_LENGTH.md +0 -9
- package/docs/helpers/constants/variables/MAX_DEEP_EQUAL_DEPTH.md +0 -9
- package/docs/helpers/constants/variables/MS_PER_MIN.md +0 -9
- package/docs/helpers/constants/variables/MS_PER_SEC.md +0 -9
- package/docs/helpers/constants/variables/default.md +0 -103
- package/docs/helpers/jsdoc-types/README.md +0 -33
- package/docs/helpers/jsdoc-types/interfaces/BufferDecoder.md +0 -23
- package/docs/helpers/jsdoc-types/interfaces/BufferEncoder.md +0 -23
- package/docs/helpers/jsdoc-types/interfaces/CacheNode.md +0 -43
- package/docs/helpers/jsdoc-types/interfaces/CommonPoolOptions.md +0 -31
- package/docs/helpers/jsdoc-types/interfaces/PendingResponseEntry.md +0 -51
- package/docs/helpers/jsdoc-types/interfaces/PostMessageOptions.md +0 -39
- package/docs/helpers/jsdoc-types/interfaces/PowerBatchOptions.md +0 -13
- package/docs/helpers/jsdoc-types/interfaces/PowerCacheOptions.md +0 -115
- package/docs/helpers/jsdoc-types/interfaces/PowerChunkingOptions.md +0 -31
- package/docs/helpers/jsdoc-types/interfaces/PowerCircuitOptions.md +0 -45
- package/docs/helpers/jsdoc-types/interfaces/PowerDeadlineOptions.md +0 -101
- package/docs/helpers/jsdoc-types/interfaces/PowerDeferOptions.md +0 -13
- package/docs/helpers/jsdoc-types/interfaces/PowerEventBusOptions.md +0 -19
- package/docs/helpers/jsdoc-types/interfaces/PowerLatchOptions.md +0 -23
- package/docs/helpers/jsdoc-types/interfaces/PowerLoggerOptions.md +0 -51
- package/docs/helpers/jsdoc-types/interfaces/PowerObserverOptions.md +0 -25
- package/docs/helpers/jsdoc-types/interfaces/PowerPoolOptions.md +0 -85
- package/docs/helpers/jsdoc-types/interfaces/PowerQueueOptions.md +0 -13
- package/docs/helpers/jsdoc-types/interfaces/PowerRetryOptions.md +0 -83
- package/docs/helpers/jsdoc-types/interfaces/PowerSlidingWindowOptions.md +0 -19
- package/docs/helpers/jsdoc-types/interfaces/PowerTTLMapOptions.md +0 -27
- package/docs/helpers/jsdoc-types/interfaces/PowerThrottleOptions.md +0 -31
- package/docs/helpers/jsdoc-types/interfaces/WorkerObj.md +0 -55
- package/docs/helpers/powerBackpressure/README.md +0 -17
- package/docs/helpers/powerBackpressure/classes/PowerBackpressure.md +0 -368
- package/docs/helpers/powerBatch/README.md +0 -17
- package/docs/helpers/powerBatch/classes/PowerBatch.md +0 -139
- package/docs/helpers/powerBuffer/README.md +0 -26
- package/docs/helpers/powerBuffer/functions/b2o.md +0 -25
- package/docs/helpers/powerBuffer/functions/o2b.md +0 -23
- package/docs/helpers/powerBuffer/functions/o2u8.md +0 -33
- package/docs/helpers/powerBuffer/functions/u82o.md +0 -30
- package/docs/helpers/powerBulkhead/README.md +0 -17
- package/docs/helpers/powerBulkhead/classes/PowerBulkhead.md +0 -302
- package/docs/helpers/powerCache/README.md +0 -29
- package/docs/helpers/powerCache/classes/PowerCache.md +0 -933
- package/docs/helpers/powerCache/classes/PowerMemoizer.md +0 -244
- package/docs/helpers/powerCache/classes/PowerTimedCache.md +0 -302
- package/docs/helpers/powerCache/functions/simpleArgsKey.md +0 -31
- package/docs/helpers/powerChunking/README.md +0 -17
- package/docs/helpers/powerChunking/classes/PowerChunker.md +0 -78
- package/docs/helpers/powerCircuit/README.md +0 -23
- package/docs/helpers/powerCircuit/classes/PowerCircuit.md +0 -167
- package/docs/helpers/powerDeadline/README.md +0 -23
- package/docs/helpers/powerDeadline/classes/PowerDeadline.md +0 -88
- package/docs/helpers/powerDefer/README.md +0 -17
- package/docs/helpers/powerDefer/classes/PowerDefer.md +0 -134
- package/docs/helpers/powerEventBus/README.md +0 -23
- package/docs/helpers/powerEventBus/classes/PowerEventBus.md +0 -330
- package/docs/helpers/powerHistogram/README.md +0 -17
- package/docs/helpers/powerHistogram/classes/PowerHistogram.md +0 -285
- package/docs/helpers/powerLatch/README.md +0 -17
- package/docs/helpers/powerLatch/classes/PowerLatch.md +0 -264
- package/docs/helpers/powerLogger/README.md +0 -17
- package/docs/helpers/powerLogger/classes/PowerLogger.md +0 -290
- package/docs/helpers/powerObserver/README.md +0 -23
- package/docs/helpers/powerObserver/classes/PowerObserver.md +0 -213
- package/docs/helpers/powerPermitGate/README.md +0 -11
- package/docs/helpers/powerPermitGate/classes/PowerPermitGate.md +0 -248
- package/docs/helpers/powerPool/README.md +0 -36
- package/docs/helpers/powerPool/classes/PowerPool.md +0 -973
- package/docs/helpers/powerPool/classes/PowerPoolShutdownError.md +0 -67
- package/docs/helpers/powerQueue/README.md +0 -11
- package/docs/helpers/powerQueue/classes/PowerQueue.md +0 -302
- package/docs/helpers/powerRateLimit/README.md +0 -17
- package/docs/helpers/powerRateLimit/classes/PowerRateLimit.md +0 -187
- package/docs/helpers/powerRetry/README.md +0 -23
- package/docs/helpers/powerRetry/classes/PowerRetry.md +0 -106
- package/docs/helpers/powerScheduler/README.md +0 -11
- package/docs/helpers/powerScheduler/classes/PowerScheduler.md +0 -135
- package/docs/helpers/powerSemaphore/README.md +0 -17
- package/docs/helpers/powerSemaphore/classes/PowerSemaphore.md +0 -173
- package/docs/helpers/powerSlidingWindow/README.md +0 -11
- package/docs/helpers/powerSlidingWindow/classes/PowerSlidingWindow.md +0 -83
- package/docs/helpers/powerSubscriberSet/README.md +0 -15
- package/docs/helpers/powerSubscriberSet/classes/PowerSubscriberSet.md +0 -251
- package/docs/helpers/powerSubscriberSet/functions/cleanupWeakRefs.md +0 -21
- package/docs/helpers/powerTTLMap/README.md +0 -17
- package/docs/helpers/powerTTLMap/classes/PowerTTLMap.md +0 -326
- package/docs/helpers/powerThrottle/README.md +0 -17
- package/docs/helpers/powerThrottle/classes/PowerThrottle.md +0 -216
- package/docs/index/README.md +0 -205
- package/docs/utils/errors/README.md +0 -12
- package/docs/utils/errors/functions/formatErrorObj.md +0 -30
- package/docs/utils/errors/functions/normalizeError.md +0 -50
- package/docs/utils/now/README.md +0 -19
- package/docs/utils/now/functions/measureAsync.md +0 -37
- package/docs/utils/now/functions/measureSync.md +0 -54
- package/docs/utils/now/functions/nowMs.md +0 -24
- package/guides/autoscale.md +0 -80
- package/guides/errors.md +0 -41
- package/guides/metaGuide.md +0 -440
- package/guides/now.md +0 -56
- package/guides/powerBackpressure.md +0 -110
- package/guides/powerBatch.md +0 -82
- package/guides/powerBuffer.md +0 -86
- package/guides/powerBulkhead.md +0 -61
- package/guides/powerCache.md +0 -269
- package/guides/powerChunking.md +0 -130
- package/guides/powerCircuit.md +0 -84
- package/guides/powerDeadline.md +0 -99
- package/guides/powerDefer.md +0 -56
- package/guides/powerEventBus.md +0 -89
- package/guides/powerHistogram.md +0 -71
- package/guides/powerLatch.md +0 -94
- package/guides/powerLogger.md +0 -129
- package/guides/powerObserver.md +0 -65
- package/guides/powerPermitGate.md +0 -52
- package/guides/powerPool.md +0 -321
- package/guides/powerQueue.md +0 -112
- package/guides/powerRateLimit.md +0 -37
- package/guides/powerRetry.md +0 -54
- package/guides/powerScheduler.md +0 -41
- package/guides/powerSemaphore.md +0 -65
- package/guides/powerSlidingWindow.md +0 -63
- package/guides/powerSubscriberSet.md +0 -48
- package/guides/powerTTLMap.md +0 -58
- package/guides/powerThrottle.md +0 -152
- package/index.html +0 -57
- package/results.json +0 -6692
- package/scripts/find-missing-jsdoc.js +0 -62
- package/scripts/modernize-optional-chaining.cjs +0 -36
- package/scripts/pool-debug.mjs +0 -29
- package/scripts/repro_powercache.js +0 -14
- package/scripts/static-audit-exports.cjs +0 -93
- package/scripts/static-audit-exports.json +0 -518
- package/test/powerBackpressure.test.js +0 -114
- package/test/powerBatch.branches.extra.test.js +0 -122
- package/test/powerBatch.test.js +0 -79
- package/test/powerBuffer.test.js +0 -125
- package/test/powerBulkhead.test.js +0 -210
- package/test/powerCache.branches.test.js +0 -233
- package/test/powerCache.bulk.test.js +0 -31
- package/test/powerCache.getorset.test.js +0 -110
- package/test/powerCache.hitRate.test.js +0 -35
- package/test/powerCache.inflight.test.js +0 -24
- package/test/powerCache.iterator.test.js +0 -18
- package/test/powerCache.misses.test.js +0 -52
- package/test/powerCache.more.test.js +0 -118
- package/test/powerCache.test.js +0 -37
- package/test/powerCache.timeout.test.js +0 -25
- package/test/powerCache.touch.test.js +0 -46
- package/test/powerChunking.branches.extra.test.js +0 -155
- package/test/powerChunking.errors.test.js +0 -177
- package/test/powerChunking.test.js +0 -39
- package/test/powerCircuit.observability.test.js +0 -71
- package/test/powerCircuit.test.js +0 -74
- package/test/powerDeadline.test.js +0 -140
- package/test/powerDefer.test.js +0 -55
- package/test/powerErrors.test.js +0 -32
- package/test/powerEventBus.branches.extra.test.js +0 -70
- package/test/powerEventBus.extra.test.js +0 -72
- package/test/powerEventBus.max.test.js +0 -43
- package/test/powerEventBus.more.test.js +0 -121
- package/test/powerEventBus.once_off.test.js +0 -17
- package/test/powerEventBus.test.js +0 -74
- package/test/powerEventBus.uncovered.test.js +0 -57
- package/test/powerEventBus.weak.test.js +0 -18
- package/test/powerHistogram.test.js +0 -73
- package/test/powerLatch.branches.extra.test.js +0 -115
- package/test/powerLatch.test.js +0 -57
- package/test/powerLogger.branches.test.js +0 -98
- package/test/powerLogger.formatter.name.test.js +0 -58
- package/test/powerLogger.json.test.js +0 -88
- package/test/powerLogger.output.test.js +0 -81
- package/test/powerLogger.table.debug.test.js +0 -77
- package/test/powerLogger.test.js +0 -59
- package/test/powerMemoizer.memoize.test.js +0 -100
- package/test/powerMemoizer.test.js +0 -85
- package/test/powerObserver.test.js +0 -129
- package/test/powerPermitGate.test.js +0 -66
- package/test/powerPool.autoTransfer.test.js +0 -100
- package/test/powerPool.autoscale.extra.test.js +0 -88
- package/test/powerPool.autoscale.test.js +0 -136
- package/test/powerPool.awaitDefaultTimeout.test.js +0 -52
- package/test/powerPool.awaitTimeout.test.js +0 -22
- package/test/powerPool.batch.test.js +0 -170
- package/test/powerPool.branches.extra2.test.js +0 -42
- package/test/powerPool.branches.test.js +0 -102
- package/test/powerPool.browser.messageerror.test.js +0 -45
- package/test/powerPool.correlation.test.js +0 -26
- package/test/powerPool.correlationId.test.js +0 -63
- package/test/powerPool.dispose.test.js +0 -49
- package/test/powerPool.drain.test.js +0 -57
- package/test/powerPool.events.test.js +0 -131
- package/test/powerPool.more.extra.test.js +0 -99
- package/test/powerPool.more.test.js +0 -283
- package/test/powerPool.node.messageerror.test.js +0 -46
- package/test/powerPool.postMessage.promise.test.js +0 -83
- package/test/powerPool.queueHigh.test.js +0 -55
- package/test/powerPool.queueSaturation.test.js +0 -51
- package/test/powerPool.rapidResize.test.js +0 -55
- package/test/powerPool.resize.overload.test.js +0 -65
- package/test/powerPool.resize.test.js +0 -70
- package/test/powerPool.shutdown.test.js +0 -38
- package/test/powerPool.stats.test.js +0 -40
- package/test/powerPool.stopThePress.test.js +0 -94
- package/test/powerPool.terminateShutdown.test.js +0 -22
- package/test/powerPool.test.js +0 -525
- package/test/powerPool.timers.test.js +0 -55
- package/test/powerPool.uncovered.test.js +0 -407
- package/test/powerPool.workerId.test.js +0 -47
- package/test/powerQueue.iterators.test.js +0 -67
- package/test/powerQueue.saturation.test.js +0 -18
- package/test/powerQueue.test.js +0 -48
- package/test/powerQueue.unshiftMany.test.js +0 -49
- package/test/powerRateLimit.atomic.test.js +0 -80
- package/test/powerRateLimit.extra.test.js +0 -145
- package/test/powerRateLimit.functions.test.js +0 -106
- package/test/powerRateLimit.test.js +0 -38
- package/test/powerRetry.attemptTimeout.test.js +0 -51
- package/test/powerRetry.test.js +0 -121
- package/test/powerScheduler.test.js +0 -126
- package/test/powerSemaphore.test.js +0 -108
- package/test/powerSlidingWindow.pool.test.js +0 -55
- package/test/powerSlidingWindow.test.js +0 -25
- package/test/powerSubscriberSet.test.js +0 -125
- package/test/powerTTLMap.test.js +0 -125
- package/test/powerThrottle.pool.test.js +0 -54
- package/test/powerThrottle.refill.test.js +0 -22
- package/test/powerThrottle.reserve.test.js +0 -46
- package/test/powerThrottle.test.js +0 -45
- package/test/powerTimedCache.test.js +0 -73
- package/test/umd.bundle.branches.test.js +0 -100
- package/test/umd.bundle.cache-timers.test.js +0 -48
- package/test/umd.bundle.exhaustive.test.js +0 -158
- package/test/umd.bundle.fuzz.test.js +0 -86
- package/test/umd.bundle.hasEqual.more.test.js +0 -68
- package/test/umd.bundle.hasEqual.test.js +0 -104
- package/test/umd.bundle.logger-extra.test.js +0 -48
- package/test/umd.bundle.more-coverage-2.test.js +0 -67
- package/test/umd.bundle.pool.test.js +0 -134
- package/test/umd.bundle.test.js +0 -265
- package/test/utils.measure.test.js +0 -49
- package/test/utils.now.extra.test.js +0 -30
- package/test/utils.now.more.test.js +0 -57
- package/tsconfig.json +0 -16
- package/typedoc.json +0 -25
- package/vite.config.js +0 -31
- package/vitest.config.js +0 -17
package/bench/results.json
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"timestamp": "2026-04-04T23:18:55.332Z",
|
|
3
|
-
"config": {
|
|
4
|
-
"mode": "pool",
|
|
5
|
-
"TASKS": 1000,
|
|
6
|
-
"ITERS": 1000000,
|
|
7
|
-
"POOL_SIZES": [
|
|
8
|
-
1,
|
|
9
|
-
2,
|
|
10
|
-
4,
|
|
11
|
-
8
|
|
12
|
-
]
|
|
13
|
-
},
|
|
14
|
-
"singleThreaded": null,
|
|
15
|
-
"pool": [
|
|
16
|
-
{
|
|
17
|
-
"size": 1,
|
|
18
|
-
"totalMs": 2299.469849,
|
|
19
|
-
"avgMs": 2.269999999999998,
|
|
20
|
-
"results": null,
|
|
21
|
-
"stats": {
|
|
22
|
-
"poolLiveDuration": 2301.187255859375,
|
|
23
|
-
"totalWorkersCreated": 1,
|
|
24
|
-
"totalTasksPerformed": 1000,
|
|
25
|
-
"averageTasksPerWorkerUntilTermination": 1000,
|
|
26
|
-
"timePerTask": {
|
|
27
|
-
"max": 6,
|
|
28
|
-
"min": 1,
|
|
29
|
-
"average": 2.269999999999998,
|
|
30
|
-
"stddev": 0.8228608630868288
|
|
31
|
-
},
|
|
32
|
-
"percentSlowTasks": 0
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"size": 2,
|
|
37
|
-
"totalMs": 848.360402,
|
|
38
|
-
"avgMs": 1.6319999999999995,
|
|
39
|
-
"results": null,
|
|
40
|
-
"stats": {
|
|
41
|
-
"poolLiveDuration": 849.44970703125,
|
|
42
|
-
"totalWorkersCreated": 2,
|
|
43
|
-
"totalTasksPerformed": 1000,
|
|
44
|
-
"averageTasksPerWorkerUntilTermination": 500,
|
|
45
|
-
"timePerTask": {
|
|
46
|
-
"max": 4,
|
|
47
|
-
"min": 1,
|
|
48
|
-
"average": 1.6319999999999995,
|
|
49
|
-
"stddev": 0.5626508686565768
|
|
50
|
-
},
|
|
51
|
-
"percentSlowTasks": 0
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"size": 4,
|
|
56
|
-
"totalMs": 455.987718,
|
|
57
|
-
"avgMs": 1.6529999999999996,
|
|
58
|
-
"results": null,
|
|
59
|
-
"stats": {
|
|
60
|
-
"poolLiveDuration": 458.03759765625,
|
|
61
|
-
"totalWorkersCreated": 4,
|
|
62
|
-
"totalTasksPerformed": 1000,
|
|
63
|
-
"averageTasksPerWorkerUntilTermination": 250,
|
|
64
|
-
"timePerTask": {
|
|
65
|
-
"max": 4,
|
|
66
|
-
"min": 1,
|
|
67
|
-
"average": 1.6529999999999996,
|
|
68
|
-
"stddev": 0.5555096758833277
|
|
69
|
-
},
|
|
70
|
-
"percentSlowTasks": 0
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"size": 8,
|
|
75
|
-
"totalMs": 322.707512,
|
|
76
|
-
"avgMs": 1.9759999999999989,
|
|
77
|
-
"results": null,
|
|
78
|
-
"stats": {
|
|
79
|
-
"poolLiveDuration": 326.047607421875,
|
|
80
|
-
"totalWorkersCreated": 8,
|
|
81
|
-
"totalTasksPerformed": 1000,
|
|
82
|
-
"averageTasksPerWorkerUntilTermination": 125,
|
|
83
|
-
"timePerTask": {
|
|
84
|
-
"max": 4,
|
|
85
|
-
"min": 1,
|
|
86
|
-
"average": 1.9759999999999989,
|
|
87
|
-
"stddev": 0.6304157358442131
|
|
88
|
-
},
|
|
89
|
-
"percentSlowTasks": 0
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
],
|
|
93
|
-
"cache": null
|
|
94
|
-
}
|
package/bench/results.md
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
# Benchmark Results
|
|
2
|
-
|
|
3
|
-
Generated: 2026-04-10T15:43:35.965Z
|
|
4
|
-
|
|
5
|
-
## Configuration
|
|
6
|
-
|
|
7
|
-
- MODE: all
|
|
8
|
-
- TASKS: 1000
|
|
9
|
-
- ITERS: 1000000
|
|
10
|
-
- POOL_SIZES: 1, 2, 4, 8
|
|
11
|
-
- LOAD_PROFILES: 0% variable, 25% variable, 50% variable, 75% variable, 100% variable
|
|
12
|
-
- BENCH_RUNS: 5
|
|
13
|
-
- POOL_RUNS: 3
|
|
14
|
-
- HELPER_OPS: 100000
|
|
15
|
-
|
|
16
|
-
Learn more about the benchmarks [here](README.md)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
## Synthetic scenario benchmarks
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Load profile: 0% variable
|
|
23
|
-
- Single-threaded total: 1577.94 ms | throughput: 634 tasks/s | p50: 1.50 ms | p95: 1.77 ms | p99: 2.55 ms
|
|
24
|
-
- Worker-thread total: 2237.89 ms
|
|
25
|
-
|
|
26
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 | Speedup |
|
|
27
|
-
| :--- | ---: | ---: | ---: | ---: | ---: |
|
|
28
|
-
| Pool | 2343.06 *(+4.3%)* | 875.79 *(+12.4%)* | 459.94 *(+10.3%)* | 324.84 *(+5.3%)* | 4.86x |
|
|
29
|
-
| Pool + Autoscale | 2397.76 *(+8.7%)* | 865.34 *(+9.3%)* | 461.56 *(+11.5%)* | 295.40 *(+8.5%)* | 5.34x |
|
|
30
|
-
| Pool + Cache | 42.89 *(+22.5%)* | 36.25 *(+22.2%)* | 34.38 *(+3.3%)* | 41.44 *(+15.4%)* | 45.90x |
|
|
31
|
-
| Pool + Cache + Autoscale | 32.97 *(-1.9%)* | `32.12` *(-7.4%)* | 34.25 *(+19.5%)* | 37.65 *(+6.5%)* | 49.13x |
|
|
32
|
-
|
|
33
|
-
### Load profile: 25% variable
|
|
34
|
-
- Single-threaded total: 1612.17 ms | throughput: 620 tasks/s | p50: 1.65 ms | p95: 2.00 ms | p99: 2.24 ms
|
|
35
|
-
- Worker-thread total: 2430.94 ms
|
|
36
|
-
|
|
37
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 | Speedup |
|
|
38
|
-
| :--- | ---: | ---: | ---: | ---: | ---: |
|
|
39
|
-
| Pool | 2383.17 *(-3.7%)* | 867.65 *(-1.8%)* | 495.19 *(-0.2%)* | 337.64 *(+4.5%)* | 4.77x |
|
|
40
|
-
| Pool + Autoscale | 2387.20 *(-3.7%)* | 875.63 *(+1.2%)* | 476.12 *(+1.8%)* | 305.36 *(+0.2%)* | 5.28x |
|
|
41
|
-
| Pool + Cache | 434.59 *(-2.2%)* | 246.52 *(+7.6%)* | 161.75 *(+23.0%)* | 119.79 *(+9.8%)* | 13.46x |
|
|
42
|
-
| Pool + Cache + Autoscale | 443.94 *(-0.1%)* | 248.89 *(-1.0%)* | 147.86 *(+6.7%)* | `107.05` *(+6.9%)* | 15.06x |
|
|
43
|
-
|
|
44
|
-
### Load profile: 50% variable
|
|
45
|
-
- Single-threaded total: 1376.89 ms | throughput: 726 tasks/s | p50: 1.45 ms | p95: 2.15 ms | p99: 2.36 ms
|
|
46
|
-
- Worker-thread total: 1970.16 ms
|
|
47
|
-
|
|
48
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 | Speedup |
|
|
49
|
-
| :--- | ---: | ---: | ---: | ---: | ---: |
|
|
50
|
-
| Pool | 1935.63 *(-9.4%)* | 739.17 *(-7.1%)* | 392.23 *(-10.4%)* | 282.08 *(-8.3%)* | 4.88x |
|
|
51
|
-
| Pool + Autoscale | 2002.47 *(-8.4%)* | 717.99 *(-7.4%)* | 385.74 *(-10.6%)* | 243.75 *(-11.5%)* | 5.65x |
|
|
52
|
-
| Pool + Cache | 792.73 *(-1.8%)* | 409.96 *(-5.2%)* | 228.45 *(-13.5%)* | 174.32 *(+0.2%)* | 7.90x |
|
|
53
|
-
| Pool + Cache + Autoscale | 807.61 *(-2.4%)* | 425.25 *(+2.8%)* | 241.02 *(+3.9%)* | `159.86` *(+1.9%)* | 8.61x |
|
|
54
|
-
|
|
55
|
-
### Load profile: 75% variable
|
|
56
|
-
- Single-threaded total: 1936.35 ms | throughput: 516 tasks/s | p50: 1.74 ms | p95: 3.61 ms | p99: 4.17 ms
|
|
57
|
-
- Worker-thread total: 2269.71 ms
|
|
58
|
-
|
|
59
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 | Speedup |
|
|
60
|
-
| :--- | ---: | ---: | ---: | ---: | ---: |
|
|
61
|
-
| Pool | 2254.53 *(-3.1%)* | 813.34 *(-4.8%)* | 440.13 *(-4.2%)* | 298.85 *(-12.8%)* | 6.48x |
|
|
62
|
-
| Pool + Autoscale | 2297.49 *(-3.1%)* | 812.14 *(-5.3%)* | 456.06 *(-2.0%)* | 274.49 *(-14.7%)* | 7.05x |
|
|
63
|
-
| Pool + Cache | 1511.73 *(-2.0%)* | 618.15 *(-3.0%)* | 329.05 *(-9.6%)* | 249.32 *(-0.5%)* | 7.77x |
|
|
64
|
-
| Pool + Cache + Autoscale | 1533.07 *(-3.6%)* | 616.75 *(-5.6%)* | 332.24 *(-5.8%)* | `217.93` *(-3.7%)* | 8.89x |
|
|
65
|
-
|
|
66
|
-
### Load profile: 100% variable
|
|
67
|
-
- Single-threaded total: 1596.12 ms | throughput: 627 tasks/s | p50: 1.59 ms | p95: 2.26 ms | p99: 2.48 ms
|
|
68
|
-
- Worker-thread total: 2229.34 ms
|
|
69
|
-
|
|
70
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 | Speedup |
|
|
71
|
-
| :--- | ---: | ---: | ---: | ---: | ---: |
|
|
72
|
-
| Pool | 2241.90 *(-2.9%)* | 828.16 *(+0.4%)* | 448.75 *(+1.4%)* | 332.92 *(+1.4%)* | 4.79x |
|
|
73
|
-
| Pool + Autoscale | 2292.29 *(-1.2%)* | 838.59 *(+1.1%)* | 453.09 *(+0.7%)* | `285.69` *(-3.8%)* | 5.59x |
|
|
74
|
-
| Pool + Cache | 2256.27 *(-0.9%)* | 836.90 *(+0.0%)* | 445.96 *(-1.6%)* | 316.87 *(-3.8%)* | 5.04x |
|
|
75
|
-
| Pool + Cache + Autoscale | 2312.00 *(-0.5%)* | 902.92 *(+9.1%)* | 453.89 *(-0.3%)* | 293.96 *(+1.7%)* | 5.43x |
|
|
76
|
-
|
|
77
|
-
## Realistic scenario benchmarks
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
### Load profile: Burstiness
|
|
81
|
-
|
|
82
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 |
|
|
83
|
-
| :--- | ---: | ---: | ---: | ---: |
|
|
84
|
-
| Pool | 2283.05 *(+1.3%)* | 827.72 *(-1.9%)* | 469.81 *(+7.5%)* | 314.75 *(+1.9%)* |
|
|
85
|
-
| Pool + Autoscale | 2303.37 *(+0.2%)* | 838.99 *(+2.4%)* | 430.56 *(-3.7%)* | 277.57 *(-9.4%)* |
|
|
86
|
-
| Pool + Cache | 61.10 *(+18.6%)* | 50.70 *(-2.1%)* | 51.10 *(+0.4%)* | `49.73` *(-3.7%)* |
|
|
87
|
-
| Pool + Cache + Autoscale | 51.35 *(+2.0%)* | 50.58 *(+0.4%)* | 50.88 *(+0.5%)* | 51.20 *(+1.6%)* |
|
|
88
|
-
|
|
89
|
-
### Load profile: Mixed task sizes
|
|
90
|
-
|
|
91
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 |
|
|
92
|
-
| :--- | ---: | ---: | ---: | ---: |
|
|
93
|
-
| Pool | 2353.29 *(-0.7%)* | 867.60 *(+0.4%)* | 447.59 *(-5.6%)* | 318.77 *(-4.4%)* |
|
|
94
|
-
| Pool + Autoscale | 2374.03 *(-1.1%)* | 849.98 *(-2.1%)* | 439.66 *(-2.7%)* | 286.32 *(-3.7%)* |
|
|
95
|
-
| Pool + Cache | 57.57 *(-0.2%)* | 40.97 *(+6.8%)* | 39.02 *(-6.4%)* | 39.33 *(+5.3%)* |
|
|
96
|
-
| Pool + Cache + Autoscale | 52.78 *(+1.7%)* | 42.62 *(+24.7%)* | `34.78` *(-6.3%)* | 42.22 *(+5.9%)* |
|
|
97
|
-
|
|
98
|
-
### Load profile: Ramp traffic
|
|
99
|
-
|
|
100
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 |
|
|
101
|
-
| :--- | ---: | ---: | ---: | ---: |
|
|
102
|
-
| Pool | 2256.29 *(-0.3%)* | 859.07 *(+5.4%)* | 434.38 *(-3.2%)* | 301.28 *(-4.8%)* |
|
|
103
|
-
| Pool + Autoscale | 2300.12 *(-0.9%)* | 822.03 *(+0.1%)* | 439.56 *(-4.8%)* | 281.51 *(+1.2%)* |
|
|
104
|
-
| Pool + Cache | 106.74 *(+0.6%)* | 106.64 *(+1.4%)* | `104.81` *(-1.5%)* | 105.49 *(-0.6%)* |
|
|
105
|
-
| Pool + Cache + Autoscale | 105.29 *(-1.4%)* | 105.49 *(-0.8%)* | 106.71 *(+1.4%)* | 105.31 *(-0.5%)* |
|
|
106
|
-
|
|
107
|
-
### Load profile: Variable payload sizes
|
|
108
|
-
|
|
109
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 |
|
|
110
|
-
| :--- | ---: | ---: | ---: | ---: |
|
|
111
|
-
| Pool | 2242.06 *(+1.5%)* | 813.73 *(-0.3%)* | 428.94 *(-3.4%)* | 301.80 *(-5.5%)* |
|
|
112
|
-
| Pool + Autoscale | 2305.47 *(+0.9%)* | 837.27 *(+3.1%)* | 433.90 *(-1.0%)* | 282.89 *(-1.9%)* |
|
|
113
|
-
| Pool + Cache | 52.09 *(-8.2%)* | 40.77 *(+1.8%)* | 39.01 *(-2.5%)* | 41.64 *(+16.9%)* |
|
|
114
|
-
| Pool + Cache + Autoscale | 54.66 *(-0.5%)* | 40.07 *(-14.5%)* | 37.97 *(-4.0%)* | `33.47` *(-18.4%)* |
|
|
115
|
-
|
|
116
|
-
### Load profile: I/O bound
|
|
117
|
-
|
|
118
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 |
|
|
119
|
-
| :--- | ---: | ---: | ---: | ---: |
|
|
120
|
-
| Pool | 2214.04 *(-2.7%)* | 838.15 *(+0.7%)* | 447.68 *(-10.9%)* | 317.35 *(+2.3%)* |
|
|
121
|
-
| Pool + Autoscale | 7783.08 *(-2.3%)* | 3866.12 *(-1.0%)* | 1794.82 *(-4.1%)* | 907.10 *(-5.2%)* |
|
|
122
|
-
| Pool + Cache | 54.68 *(-20.9%)* | 53.24 *(-2.9%)* | 44.79 *(+3.9%)* | `42.70` *(+1.3%)* |
|
|
123
|
-
| Pool + Cache + Autoscale | 171.80 *(-15.4%)* | 97.46 *(+3.8%)* | 68.64 *(-3.3%)* | 51.58 *(+4.8%)* |
|
|
124
|
-
|
|
125
|
-
### Load profile: Thundering herd
|
|
126
|
-
|
|
127
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 |
|
|
128
|
-
| :--- | ---: | ---: | ---: | ---: |
|
|
129
|
-
| Pool | 2364.49 *(+5.1%)* | 808.02 *(-0.2%)* | 439.85 *(-5.9%)* | 304.33 *(-0.1%)* |
|
|
130
|
-
| Pool + Autoscale | 2286.78 *(-1.4%)* | 846.26 *(+1.9%)* | 502.54 *(+12.5%)* | 276.90 *(+1.2%)* |
|
|
131
|
-
| Pool + Cache | 26.45 *(+22.1%)* | 28.90 *(+51.2%)* | 30.40 *(+29.0%)* | 28.86 *(+1.1%)* |
|
|
132
|
-
| Pool + Cache + Autoscale | 21.01 *(-25.0%)* | 30.84 *(+9.1%)* | `19.81` *(-28.2%)* | 29.67 *(+28.2%)* |
|
|
133
|
-
|
|
134
|
-
### Load profile: Cache hit ratio 10%
|
|
135
|
-
|
|
136
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 |
|
|
137
|
-
| :--- | ---: | ---: | ---: | ---: |
|
|
138
|
-
| Pool | 2274.52 *(+0.8%)* | 806.12 *(-2.4%)* | 418.92 *(-2.4%)* | 309.95 *(-0.4%)* |
|
|
139
|
-
| Pool + Autoscale | 2290.89 *(+0.7%)* | 813.45 *(-2.4%)* | 439.40 *(+1.0%)* | 283.26 *(+2.0%)* |
|
|
140
|
-
| Pool + Cache | 1982.23 *(-3.0%)* | 736.75 *(-2.9%)* | 387.88 *(-14.4%)* | 306.82 *(+0.4%)* |
|
|
141
|
-
| Pool + Cache + Autoscale | 2041.72 *(+1.1%)* | 764.39 *(+1.9%)* | 390.41 *(-8.0%)* | `261.86` *(-1.2%)* |
|
|
142
|
-
|
|
143
|
-
### Load profile: Cache hit ratio 50%
|
|
144
|
-
|
|
145
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 |
|
|
146
|
-
| :--- | ---: | ---: | ---: | ---: |
|
|
147
|
-
| Pool | 2260.67 *(-3.7%)* | 821.89 *(+1.1%)* | 467.33 *(+8.2%)* | 321.76 *(+1.6%)* |
|
|
148
|
-
| Pool + Autoscale | 2285.72 *(-4.6%)* | 858.44 *(+1.5%)* | 447.27 *(-0.3%)* | 270.65 *(+0.5%)* |
|
|
149
|
-
| Pool + Cache | 912.54 *(-3.8%)* | 455.78 *(-0.3%)* | 269.53 *(+9.6%)* | 198.97 *(+6.6%)* |
|
|
150
|
-
| Pool + Cache + Autoscale | 948.54 *(+0.4%)* | 472.62 *(-1.5%)* | 254.66 *(-0.9%)* | `181.50` *(+4.3%)* |
|
|
151
|
-
|
|
152
|
-
### Load profile: Cache hit ratio 90%
|
|
153
|
-
|
|
154
|
-
| Pattern \ Pool size | 1 | 2 | 4 | 8 |
|
|
155
|
-
| :--- | ---: | ---: | ---: | ---: |
|
|
156
|
-
| Pool | 2342.29 *(+3.2%)* | 823.22 *(+2.0%)* | 448.98 *(-2.3%)* | 323.21 *(+2.6%)* |
|
|
157
|
-
| Pool + Autoscale | 2330.49 *(+2.9%)* | 822.07 *(+0.9%)* | 455.63 *(+3.1%)* | 288.37 *(-0.2%)* |
|
|
158
|
-
| Pool + Cache | 254.17 *(-2.9%)* | 157.29 *(+14.3%)* | 105.66 *(+25.8%)* | 75.56 *(-1.2%)* |
|
|
159
|
-
| Pool + Cache + Autoscale | 271.25 *(-0.6%)* | 154.49 *(+1.8%)* | 89.79 *(+0.2%)* | `67.60` *(-7.4%)* |
|
|
160
|
-
|
|
161
|
-
## Cache benchmark
|
|
162
|
-
|
|
163
|
-
- Miss total: 3.64 ms
|
|
164
|
-
- Hit total (5 reps): 1.49 ms
|
|
165
|
-
- Keys tested: 1000
|
|
166
|
-
|
|
167
|
-
### Cache eviction under pressure
|
|
168
|
-
|
|
169
|
-
- maxEntries: 200 (20% of 1000 unique keys)
|
|
170
|
-
- Miss pass total: 3.38 ms
|
|
171
|
-
- Hit pass under eviction: 0.27 ms
|
|
172
|
-
|
|
173
|
-
### Serial vs concurrent getOrSetAsync (in-flight deduplication)
|
|
174
|
-
|
|
175
|
-
- Tasks: 1000 | Unique keys: 10
|
|
176
|
-
- Serial (no dedup): 10.30 ms
|
|
177
|
-
- Concurrent (dedup): 1.48 ms (85.6% faster)
|
|
178
|
-
|
|
179
|
-
- Cache getOrSetAsync dedupe total: 15.78 ms
|
|
180
|
-
- Cache getOrSetAsync avg per task: 0.02 ms
|
|
181
|
-
- Cache getOrSetAsync duplicate keys: 10
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
## Cache warmup benchmark
|
|
185
|
-
|
|
186
|
-
- Keys tested: 20
|
|
187
|
-
- Cold-start total: 32.20 ms
|
|
188
|
-
- Warm-start total: 0.23 ms
|
|
189
|
-
|
|
190
|
-
- PowerMemoizer total: 16.54 ms
|
|
191
|
-
- PowerMemoizer avg per call: 0.02 ms
|
|
192
|
-
- PowerMemoizer duplicate keys: 10
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
## Helper micro-benchmarks
|
|
196
|
-
|
|
197
|
-
_100,000 ops per variant, median of 5 runs_
|
|
198
|
-
|
|
199
|
-
| Helper | Variant | Total (ms) | ops/sec | Δ prev |
|
|
200
|
-
| :--- | :--- | ---: | ---: | ---: |
|
|
201
|
-
| **PowerRateLimit** | under rate (all pass) | 19.76 | 5,060,900 | -0.5% |
|
|
202
|
-
| **PowerRateLimit** | over rate (~50% reject) | 14.85 | 6,735,604 | +0.3% |
|
|
203
|
-
| **PowerCircuit** | closed (happy path) | 1.45 | 13,754,212 | -11.3% |
|
|
204
|
-
| **PowerCircuit** | open (fast-fail) | 40.21 | 497,449 | -1.8% |
|
|
205
|
-
| **PowerRetry** | 1 attempt (no retry) | 1.08 | 9,255,154 | -24.6% |
|
|
206
|
-
| **PowerRetry** | 2 attempts (1 retry, baseDelay=0) | 10849.06 | 922 | -0.5% |
|
|
207
|
-
| **PowerSemaphore** | limit=1 (exclusive lock, serial) | 5.04 | 9,922,797 | -3.1% |
|
|
208
|
-
| **PowerSemaphore** | limit=8 (concurrent pool) | 20.95 | 2,386,079 | -17.2% |
|
|
209
|
-
| **PowerBulkhead** | 1 partition (baseline) | 17.78 | 1,125,023 | +1.1% |
|
|
210
|
-
| **PowerBulkhead** | 2 partitions (critical vs background) | 18.37 | 1,088,494 | +10.5% |
|
|
211
|
-
| **PowerBatch** | individual dispatch (maxSize=1) | 33.96 | 2,944,420 | +16.3% |
|
|
212
|
-
| **PowerBatch** | coalesced dispatch (maxSize=ops) | 6.64 | 15,059,858 | -1.8% |
|
|
213
|
-
| **PowerBackpressure** | no pressure (capacity >> ops) | 2.02 | 14,851,309 | +44.9% |
|
|
214
|
-
| **PowerBackpressure** | with pressure (capacity=100) | 7.19 | 4,170,700 | +66.5% |
|
|
215
|
-
| **PowerTTLMap** | long TTL (60 s, no eviction) | 24.63 | 4,060,904 | -4.7% |
|
|
216
|
-
| **PowerTTLMap** | short TTL (1 ms, high eviction) | 24.61 | 4,063,041 | +1.7% |
|
|
217
|
-
| **PowerEventBus** | 1 subscriber | 1.65 | 60,554,644 | +1.1% |
|
|
218
|
-
| **PowerEventBus** | 10 subscribers | 6.04 | 16,556,286 | +1.9% |
|
|
219
|
-
| **PowerEventBus** | 50 subscribers | 26.36 | 3,793,868 | +2.7% |
|
|
220
|
-
| **PowerEventBus** | 100 subscribers | 49.23 | 2,031,457 | +0.2% |
|
|
221
|
-
| **PowerDeadline** | success (task within deadline) | 6.24 | 801,553 | +11.4% |
|
|
222
|
-
| **PowerDeadline** | abort (task exceeds 1 ms deadline) | 5516.23 | 906 | +3.0% |
|
|
223
|
-
| **PowerSlidingWindow** | under capacity (all pass) | 11.14 | 8,973,321 | +1.8% |
|
|
224
|
-
| **PowerSlidingWindow** | at capacity (~50% reject) | 10.54 | 9,488,115 | +2.6% |
|
|
225
|
-
| **PowerQueue** | push x100000 + shift x100000 | 0.99 | 100,811,228 | -4.7% |
|
|
226
|
-
| **PowerQueue** | interleaved push+shift (steady state) | 0.42 | 239,725,945 | +0.7% |
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
## Δ vs previous run
|
|
230
|
-
|
|
231
|
-
_Pool/scenario: flagged when >±35% AND >±50 ms. Helpers: flagged when >±20% AND >±8 ms._
|
|
232
|
-
|
|
233
|
-
_All results within thresholds — no significant changes detected._
|