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#popwhen possible. - Custom queue avoiding the super slow
Array#shift. - Give a hidden class to internal objects.
- Keep internal code monomorphic.
Contextinternal flags are nowbooleans.
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.
uglifyhas been configured to mangle internal properties in order save more bytes.gziphandles redundancies by design.
API consistency
The following changes have been made:
childrenKeyhas been replaced by agetChildrenfunction that returns the children of a node.- All traversal orders now support every
Contextoperation, which was not exactly the case before. Contextdoes not expose thepathanymore. It's a greedy feature (especially for BFS) and it's something the user can achieve on its own if it's really needed.