Skip to content

Releases: ngryman/tree-crawl

v1.1.0

10 Nov 06:52
23e9a36
Compare
Choose a tag to compare

1.0.0

14 Apr 10:23
v1.0.0
Compare
Choose a tag to compare

This release focuses on BFS, performance, byte loss and API consistency.

Highlights

BFS

Welcome to BFS traversal 🎉

Performance

1.0.0 brings a x3/4 performance boost compared to 0.6.1. The library has been completely rewritten to be more performant and optimizer-friendly:

  • No recursion.
  • Custom stack avoiding Array#pop when possible.
  • Custom queue avoiding the super slow Array#shift.
  • Give a hidden class to internal objects.
  • Keep internal code monomorphic.
  • Context internal flags are now booleans.

Byte loss

We now expose a prebuilt minified version of 1087 bytes gziped:

  • The new code is smaller and isolated which makes it minifier-friendly.
  • uglify has been configured to mangle internal properties in order save more bytes.
  • gzip handles redundancies by design.

API consistency

The following changes have been made:

  • childrenKey has been replaced by a getChildren function that returns the children of a node.
  • All traversal orders now support every Context operation, which was not exactly the case before.
  • Context does not expose the path anymore. It's a greedy feature (especially for BFS) and it's something the user can achieve on its own if it's really needed.

Changelog

v0.6.1...v1.0.0