arb / celebrate

A joi validation middleware for Express.
MIT License
1.34k stars 65 forks source link

Perf updates #61

Closed arb closed 6 years ago

arb commented 6 years ago

Added some benchmarking tooling to have an idea of how changes affect performance Moved code around to allow for more constant values and fewer memory allocations Switch to non-callback validation function to remove extra closure

We may want to log the benchmarks to see how that look over time or across different node versions...

valid x 28,130 ops/sec ±1.68% (85 runs sampled)
invalid x 16,185 ops/sec ±1.85% (85 runs sampled)

This run was with these changes on node 6

Previous run before changes

valid x 27,035 ops/sec ±1.02% (82 runs sampled)
invalid x 15,341 ops/sec ±1.72% (80 runs sampled)