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

Possible improvements for RBTree #492

Open
luc-blaeser opened this issue Jan 5, 2023 · 5 comments
Open

Possible improvements for RBTree #492

luc-blaeser opened this issue Jan 5, 2023 · 5 comments

Comments

@luc-blaeser
Copy link
Contributor

Possible improvements for RBTree:

  • Reduce garbage creation, especially during reading functions, such as get() and iteration.
  • More efficient size() function.
luc-blaeser added a commit that referenced this issue Jan 5, 2023
Improve `RBTree.mo`:
* Documentation
* Unit tests

Possible improvements for `RBTree` (#492):
* Reduce garbage creation, especially during reading functions, such as `get()` and iteration.
* More efficient `size()` function.
ggreif pushed a commit that referenced this issue Jan 5, 2023
Improve `RBTree.mo`:
* Documentation
* Unit tests

Possible improvements for `RBTree` (#492):
* Reduce garbage creation, especially during reading functions, such as `get()` and iteration.
* More efficient `size()` function.
@matthewhammer
Copy link
Contributor

matthewhammer commented Jan 11, 2023

Another long-standing issue with RBTree is that it does not fully support delete.

Separately but also related, RBTree is purely functional. So maybe some users would consider an additional imperative version to be another dimension of improvement?

@crusso
Copy link
Contributor

crusso commented Jan 11, 2023

We should probably round out the functional one before adding an imperative one. Ie implement purely functional delete. Is it hard? Genuine question.

crusso added a commit that referenced this issue Jan 13, 2023
Fixes issue #492 and adds some  basic tests.

- [x] test binomial consumes input

- [x] test the static functions.

Co-authored-by: Ryan Vandersmith <ryan.vandersmith@dfinity.org>
@crusso
Copy link
Contributor

crusso commented Jan 13, 2023

(Sorry, didn't mean to reference this issue from irrelevant PR #500 - meant #499)

@timohanke
Copy link

Reduce garbage creation, especially during reading functions, such as get() and iteration

General question: How can get() produce garbage? It's only reading. Recursion builds up the stack but that isn't garbage. What am I missing?

@timohanke
Copy link

Separately but also related, RBTree is purely functional. So maybe some users would consider an additional imperative version to be another dimension of improvement?

I wonder what kind of improvement we can expect from an imperative one. Wouldn't it end up looking very similar and have the same representation? What would get improved?

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

No branches or pull requests

4 participants