-
-
Notifications
You must be signed in to change notification settings - Fork 212
Improve performance of stdlib immutable Map on JavaScript #328
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
Improve performance of stdlib immutable Map on JavaScript #328
Conversation
|
One question is where is |
|
inspect is implemented in the ffi parts: Erlang: https://github.com/gleam-lang/stdlib/blob/main/src/gleam_stdlib.erl#L324-L377= For isEqual see https://github.com/gleam-lang/gleam/blob/main/compiler-core/templates/prelude.js#L301= I think |
|
Thanks inoas :) We somehow need to get the new Map class into prelude or find a workaround where we don't need to do that. I'm not sure which path to take here. Some options:
|
|
3 sounds like it would be useful for other future user implemented data structures as well as this one. Let's go for that one. I could imagine us in future promoting the JavaScript map implementation into core, but let's be conservative and keep it in the standard library for now. |
to reduce the number of nodes created
lpil
left a comment
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.
Beautiful work! I've left some questions
|
Hey @schurhammer ! I finally got to the bottom of my github inbox now that I'm full time on Gleam 😁 Is this something you would like to continue with? |
lpil
left a comment
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.
Incredible work, thank you so much! I am really super impressed and grateful 💜
|
I've rebase this into main |
Issue gleam-lang/gleam#1262
Still WIP but creating PR for feedback.
Reference Implementation
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/PersistentHashMap.java