UNPKG

enumset32-benchmarks

Version:

Benchmarks for enumset32 vs other set implementations

88 lines (58 loc) 3.71 kB
enumset32 benchmarks ==================== ## Comparative performance of set implementations These benchmarks compare the **relative** performance of [ES2015 Native Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set), enumset32, [fp-ts](https://github.com/gcanti/fp-ts) & [Lodash](https://github.com/lodash/lodash) with respect to common set operations. Benchmarks conducted with Node.js v10.15.3 running on a 2.4 GHz iMac desktop. **Taller bars indicate superior performance and, in some cases, by 1 to 2 orders of magnitude better with *enumset32*!** <!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> - [Benchmark 1. Instantiating sets](#benchmark-1-instantiating-sets) - [Benchmark 2. Testing membership of a set](#benchmark-2-testing-membership-of-a-set) - [Benchmark 3. Testing two sets for equality](#benchmark-3-testing-two-sets-for-equality) - [Benchmark 4. Evaluating the complement of a set](#benchmark-4-evaluating-the-complement-of-a-set) - [Benchmark 5. Evaluating the union of two sets](#benchmark-5-evaluating-the-union-of-two-sets) - [Benchmark 6. Evaluating the intersection of two sets](#benchmark-6-evaluating-the-intersection-of-two-sets) - [Benchmark 7. Evaluating the difference of two sets](#benchmark-7-evaluating-the-difference-of-two-sets) - [Benchmark 8. Evaluating the symmetric difference of two sets](#benchmark-8-evaluating-the-symmetric-difference-of-two-sets) <!-- END doctoc generated TOC please keep comment here to allow auto update --> ### Benchmark 1. Instantiating sets <div> <img width="500" height="340" src="https://github.com/Typeverse/enumset32/raw/master/benchmarks/doc/Set creation.svg?sanitize=true"> </div> ### Benchmark 2. Testing membership of a set <div> <img width="500" height="340" src="https://github.com/Typeverse/enumset32/raw/master/benchmarks/doc/Set membership.svg?sanitize=true"> </div> ### Benchmark 3. Testing two sets for equality <div> <img width="500" height="340" src="https://github.com/Typeverse/enumset32/raw/master/benchmarks/doc/Set equality.svg?sanitize=true"> </div> ### Benchmark 4. Evaluating the [complement](https://en.wikipedia.org/wiki/Complement_(set_theory)) of a set <div> <img width="500" height="340" src="https://github.com/Typeverse/enumset32/raw/master/benchmarks/doc/Set complement.svg?sanitize=true"> </div> ### Benchmark 5. Evaluating the [union](https://en.wikipedia.org/wiki/Union_(set_theory)) of two sets <div> <img width="500" height="340" src="https://github.com/Typeverse/enumset32/raw/master/benchmarks/doc/Set union.svg?sanitize=true"> </div> ### Benchmark 6. Evaluating the [intersection](https://en.wikipedia.org/wiki/Intersection_(set_theory)) of two sets <div> <img width="500" height="340" src="https://github.com/Typeverse/enumset32/raw/master/benchmarks/doc/Set intersection.svg?sanitize=true"> </div> ### Benchmark 7. Evaluating the [difference](https://en.wikipedia.org/wiki/Complement_(set_theory)) of two sets <div> <img width="500" height="340" src="https://github.com/Typeverse/enumset32/raw/master/benchmarks/doc/Set difference.svg?sanitize=true"> </div> ### Benchmark 8. Evaluating the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) of two sets <div> <img width="500" height="340" src="https://github.com/Typeverse/enumset32/raw/master/benchmarks/doc/Set symmetric difference.svg?sanitize=true"> </div> ## License Mozilla Public License Version 2.0 ([MPL-2.0](./LICENSE)). Copyright © 2019 Justin Johansson ([https://github.com/indiescripter](https://github.com/indiescripter)).