Releases: ngryman/tree-crawl
Releases · ngryman/tree-crawl
v1.1.0
1.0.0
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 nowboolean
s.
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 agetChildren
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 thepath
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.