-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Optimizing conj and assoc and making their behavior match clj's more closely #17
Optimizing conj and assoc and making their behavior match clj's more closely #17
Conversation
fixes for tests
Appreciate this PR! Thanks a lot. I do prefer to work in small PRs that don't add a ton of stuff in one go, so it's easier to review. About About prettier: why is cc @lilactown |
Did some benchmarking and found that using an imperative counter is faster than using |
…closely (#17) * WIP optimizing conj and assoc and making their behavior more match clj's * fix conj tests * fix calling namespace on non-kw in map emit * Fix some bugs in assoc/conj and add more tests for them * Fill out the remainder of tests and fix more bugs * Remove some prettier formatting that was accidentally applied * Bonus get + assoc-in + assoc-in! * Added tests for str and optimized it. Co-authored-by: Will Acton <will@willacton.com> Co-authored-by: Michiel Borkent <michielborkent@gmail.com>
These appear to be significantly faster than the original functions and handle more corner cases in order to more closely match clojure's conj/assoc functions.
EDIT: I added get + assoc-in + assoc-in! as a bonus on this PR, and sped up str / added tests for it.