Skip to content

Use Map for TrieNode children#27

Merged
trekhleb merged 1 commit into
trekhleb:masterfrom
caub:trie-Map
May 29, 2018
Merged

Use Map for TrieNode children#27
trekhleb merged 1 commit into
trekhleb:masterfrom
caub:trie-Map

Conversation

@caub

@caub caub commented May 28, 2018

Copy link
Copy Markdown
Contributor

Map are more suitable and efficient for dynamically shaped hashes (quick benchmark)

@codecov-io

codecov-io commented May 28, 2018

Copy link
Copy Markdown

Codecov Report

Merging #27 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #27   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          78     78           
  Lines        1625   1623    -2     
  Branches      289    288    -1     
=====================================
- Hits         1625   1623    -2
Impacted Files Coverage Δ
src/data-structures/trie/TrieNode.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 30ae323...8e288e2. Read the comment docs.

@trekhleb

Copy link
Copy Markdown
Owner

@caub
Thank you for submission! The code looks much cleaner with using Map() and that is nice.
But could you please revert your changes in package-lock.json? Seems like they are not relevant, aren't they?

@caub

caub commented May 28, 2018

Copy link
Copy Markdown
Contributor Author

done
There's one thing slower with Map though, it's [...map.keys()] vs Object.keys(obj), but I think .suggestChildren is not used too often

@trekhleb

Copy link
Copy Markdown
Owner

Great! Thank you for contribution!

@trekhleb trekhleb merged commit b1a613e into trekhleb:master May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants