PPP
A slim promise implementation.
- Status:
UNSTABLE
- Versions0.8.x
are preview releases, with possible API breaking changes between patch versions. I look forward to nailing down the API for version1.0.x
.
Goals
- to provide a simple, no-frills, compliant promise implementation.
- to limit the use of closure scope / function binding in an effort to lower memory thrashing in projects that make extensive promise use.
- to provide a measure of debug-ability despite asynchronous execution.
Usage
npm install ppp
var ppp = ; var defer = pppPromisedefer; deferpromise; defer;
As a native polyfill
{ if !globalPromise globalPromise = Promise; }this;
Resources
Benchmarks
grunt benchmark
# Memory:All
ppp@0.8.6: 1.65 MB ±0.08 MB
bluebird@2.9.30: 1.96 MB ±0.15 MB
q@1.4.1: 6.66 MB ±1.05 MB
vow@0.4.10: 3.65 MB ±0.38 MB
# Memory:Then
ppp@0.8.6: 0.63 MB ±0.04 MB
bluebird@2.9.30: 1.31 MB ±0.13 MB
q@1.4.1: 3.52 MB ±0.49 MB
vow@0.4.10: 1.37 MB ±0.15 MB
# Cpu:All
ppp@0.8.6: 461 ops/sec ±1.18 %
bluebird@2.9.30: 419 ops/sec ±1.44 %
q@1.4.1: 142 ops/sec ±3.94 %
vow@0.4.10: 426 ops/sec ±1.10 %
# Cpu:Then
ppp@0.8.6: 486 ops/sec ±1.39 %
bluebird@2.9.30: 417 ops/sec ±2.03 %
q@1.4.1: 191 ops/sec ±3.40 %
vow@0.4.10: 459 ops/sec ±1.51 %
test/benchmark.html
(Chrome)
# Cpu:All
ppp: 156 ops/sec ±0.61 %
bluebird: 78.70 ops/sec ±0.48 %
q: 134 ops/sec ±4.08 %
vow: 155 ops/sec ±0.77 %
# Cpu:Then
ppp: 158 ops/sec ±0.61 %
bluebird: 76.47 ops/sec ±1.20 %
q: 159 ops/sec ±2.70 %
vow: 156 ops/sec ±0.37 %