Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: optimize tree container #159

Merged
merged 6 commits into from
Feb 28, 2023
Merged

perf: optimize tree container #159

merged 6 commits into from
Feb 28, 2023

Conversation

ZLY201
Copy link
Member

@ZLY201 ZLY201 commented Feb 24, 2023

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

The PR fulfills these requirements:

  • It's submitted to the dev branch, not the main branch
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • All tests are passing
  • New/updated tests are included

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@ZLY201 ZLY201 added the enhancement New feature or request label Feb 24, 2023
@ZLY201 ZLY201 self-assigned this Feb 24, 2023
@coveralls
Copy link
Collaborator

coveralls commented Feb 24, 2023

Coverage Status

Coverage: 100.0%. Remained the same when pulling 6884c79 on perf/tree_container into bd2b14f on dev.

@github-actions
Copy link

github-actions bot commented Feb 24, 2023

Size Change: +17.9 kB (+2%)

Total Size: 783 kB

Filename Size Change
./dist/cjs/container/TreeContainer/Base/index.js 13.5 kB -1.11 kB (-8%)
./dist/cjs/container/TreeContainer/Base/TreeNode.js 2.35 kB -49 B (-2%)
./dist/cjs/container/TreeContainer/OrderedMap.js 3.62 kB +474 B (+15%) ⚠️
./dist/cjs/container/TreeContainer/OrderedSet.js 2.96 kB +380 B (+15%) ⚠️
./dist/esm/container/TreeContainer/Base/index.js 15.4 kB -2.48 kB (-14%) 👏
./dist/esm/container/TreeContainer/Base/TreeNode.js 3.48 kB +4 B (0%)
./dist/esm/container/TreeContainer/OrderedMap.js 8.2 kB +128 B (+2%)
./dist/esm/container/TreeContainer/OrderedSet.js 7.45 kB +37 B (0%)
./dist/isolate/ordered-map/dist/cjs/index.js 20.4 kB -675 B (-3%)
./dist/isolate/ordered-map/dist/esm/index.js 27.6 kB -1.81 kB (-6%)
./dist/isolate/ordered-map/dist/umd/ordered-map.js 40.9 kB -2.09 kB (-5%)
./dist/isolate/ordered-map/dist/umd/ordered-map.min.js 10.8 kB -870 B (-7%)
./dist/isolate/ordered-set/dist/cjs/index.js 19.7 kB -768 B (-4%)
./dist/isolate/ordered-set/dist/esm/index.js 26.9 kB -1.91 kB (-7%)
./dist/isolate/ordered-set/dist/umd/ordered-set.js 39.7 kB -2.2 kB (-5%)
./dist/isolate/ordered-set/dist/umd/ordered-set.min.js 10.5 kB -901 B (-8%)
./dist/umd/js-sdsl.js 107 kB -1.08 kB (-1%)
./dist/umd/js-sdsl.min.js 32.8 kB +32.8 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
./dist/cjs/container/ContainerBase/index.js 659 B
./dist/cjs/container/HashContainer/Base/index.js 4.86 kB
./dist/cjs/container/HashContainer/HashMap.js 3 kB
./dist/cjs/container/HashContainer/HashSet.js 2.04 kB
./dist/cjs/container/OtherContainer/PriorityQueue.js 2.68 kB
./dist/cjs/container/OtherContainer/Queue.js 1.13 kB
./dist/cjs/container/OtherContainer/Stack.js 749 B
./dist/cjs/container/SequentialContainer/Base/index.js 317 B
./dist/cjs/container/SequentialContainer/Base/RandomIterator.js 1.62 kB
./dist/cjs/container/SequentialContainer/Deque.js 9.18 kB
./dist/cjs/container/SequentialContainer/LinkList.js 7.62 kB
./dist/cjs/container/SequentialContainer/Vector.js 3.48 kB
./dist/cjs/container/TreeContainer/Base/TreeIterator.js 2.03 kB
./dist/cjs/index.js 2.43 kB
./dist/cjs/utils/checkObject.js 259 B
./dist/cjs/utils/throwError.js 268 B
./dist/esm/container/ContainerBase/index.js 1.79 kB
./dist/esm/container/HashContainer/Base/index.js 5.67 kB
./dist/esm/container/HashContainer/HashMap.js 7.31 kB
./dist/esm/container/HashContainer/HashSet.js 6.38 kB
./dist/esm/container/OtherContainer/PriorityQueue.js 4.83 kB
./dist/esm/container/OtherContainer/Queue.js 2 kB
./dist/esm/container/OtherContainer/Stack.js 1.63 kB
./dist/esm/container/SequentialContainer/Base/index.js 1.14 kB
./dist/esm/container/SequentialContainer/Base/RandomIterator.js 2.48 kB
./dist/esm/container/SequentialContainer/Deque.js 14.6 kB
./dist/esm/container/SequentialContainer/LinkList.js 12.3 kB
./dist/esm/container/SequentialContainer/Vector.js 9.19 kB
./dist/esm/container/TreeContainer/Base/TreeIterator.js 2.94 kB
./dist/esm/index.js 796 B
./dist/esm/utils/checkObject.js 166 B
./dist/esm/utils/throwError.js 139 B
./dist/isolate/deque/dist/cjs/index.js 10.7 kB
./dist/isolate/deque/dist/esm/index.js 17.1 kB
./dist/isolate/deque/dist/umd/deque.js 23.7 kB
./dist/isolate/deque/dist/umd/deque.min.js 8.8 kB
./dist/isolate/hash-map/dist/cjs/index.js 7.38 kB
./dist/isolate/hash-map/dist/esm/index.js 12.7 kB
./dist/isolate/hash-map/dist/umd/hash-map.js 19.3 kB
./dist/isolate/hash-map/dist/umd/hash-map.min.js 6.14 kB
./dist/isolate/hash-set/dist/cjs/index.js 6.6 kB
./dist/isolate/hash-set/dist/esm/index.js 11.8 kB
./dist/isolate/hash-set/dist/umd/hash-set.js 17.8 kB
./dist/isolate/hash-set/dist/umd/hash-set.min.js 5.75 kB
./dist/isolate/link-list/dist/cjs/index.js 7.7 kB
./dist/isolate/link-list/dist/esm/index.js 13.2 kB
./dist/isolate/link-list/dist/umd/link-list.js 18.6 kB
./dist/isolate/link-list/dist/umd/link-list.min.js 6.32 kB
./dist/isolate/priority-queue/dist/cjs/index.js 2.76 kB
./dist/isolate/priority-queue/dist/esm/index.js 5.2 kB
./dist/isolate/priority-queue/dist/umd/priority-queue.js 10.8 kB
./dist/isolate/priority-queue/dist/umd/priority-queue.min.js 3.07 kB
./dist/isolate/queue/dist/cjs/index.js 1.21 kB
./dist/isolate/queue/dist/esm/index.js 2.42 kB
./dist/isolate/queue/dist/umd/queue.js 5.52 kB
./dist/isolate/queue/dist/umd/queue.min.js 1.78 kB
./dist/isolate/stack/dist/cjs/index.js 829 B
./dist/isolate/stack/dist/esm/index.js 2.06 kB
./dist/isolate/stack/dist/umd/stack.js 4.9 kB
./dist/isolate/stack/dist/umd/stack.min.js 1.59 kB
./dist/isolate/vector/dist/cjs/index.js 4.97 kB
./dist/isolate/vector/dist/esm/index.js 11.6 kB
./dist/isolate/vector/dist/umd/vector.js 15.7 kB
./dist/isolate/vector/dist/umd/vector.min.js 6.1 kB

compressed-size-action

@ZLY201
Copy link
Member Author

ZLY201 commented Feb 24, 2023

That's strange why firefox 31 mocha tests passed. Symbol.iterator is not supported in firefox 31.

@ZLY201 ZLY201 merged commit fbab56c into dev Feb 28, 2023
@ZLY201 ZLY201 deleted the perf/tree_container branch February 28, 2023 08:47
ZLY201 added a commit that referenced this pull request Mar 22, 2023
* perf: optimize tree container (#159)

* docs: update readme

* refactor: optimize tree code

* perf: optimize tree inOrder travel

* docs: update changelog

* chore: upgrade devDependencies

* chore: fix eslint compat error

* perf: optimized many places (#162)

* perf: do some optimization on details

* perf: optimize deque and symbol.iterator

* test: add new deque tests

* docs: add new comments

* chore: upgrade devDependencies

* docs: update changelog

* docs: update changelog

* chore: change firefox version to 36 (#163)

* build: publish@4.4.0 (#165)

* perf: save memory overhead for tree container traversal (#166)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants