Skip to content

mattbierner/javascript-tree-traversal-iterator-optimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Javascript Tree Traversal Iterator Optimization

A small benchmark comparing the performance of various methods of creating an ES6 iterator over a k-ary tree.

Apep

Usage

$ npm install
$ npm run benchmark

Adding a new benchmark

All implementations are stored in ./benchmarks/. To add a new one, simply create a new file that looks like this:

"use strict";

module.exports = {
    name: "Benchmark name",
    impl: tree => /* create iterator here */
};

Then in index.js, add the iterator to the pre_benchmarks like so:

const pre_benchmarks = [
    ...,
    iteratorTest(require('./benchmarks/my_new_benchmark'))
];

It will now be included in the test.

Trees are simply:

function Node(value, children) {
    this.value = value;
    this.children = children;
};

where children is an array of child nodes.

About

A small benchmark comparing the performance of various methods of creating an ES6 iterator over a k-ary tree

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published