-
Notifications
You must be signed in to change notification settings - Fork 24
Help needed / Less set garbage #896
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
Conversation
Thanks @beauby for helping me on this! For example, calls to E.g. in
, we can see
|
A solution would be to box stuff before passing it to |
if (phys_eq(newL, l)) this else SortedMap::balance(k, v, newL, r) | ||
| EQ() -> | ||
newV = f(v, value); | ||
if (phys_eq(newV, v)) this else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the problematic call, or are there others? This one could perhaps be replaced with the ==
from the Equality
trait on V
without being slow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I guess the thrust of my question is: is this the only call to phys_eq added in this PR for a value class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is.
By the way, there is currently no constraint that V
implements Equality
- Few commits from #896 - Stuff
I was trying to reduce the temporary garbage added by #886 by optimizing
SortedSet/Map
when the same element is added over and over again, by using physical equality as I would do in OCaml, though SKDB wasm tests are not happy with it, they throw anunreachable
exception, e.g.Anyone knowledgeable with compilation to WASM has an idea on this?