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

Experiment with Clojure vector implementation #628

Closed
jfacorro opened this issue May 17, 2019 · 1 comment
Closed

Experiment with Clojure vector implementation #628

jfacorro opened this issue May 17, 2019 · 1 comment

Comments

@jfacorro
Copy link
Member

jfacorro commented May 17, 2019

After adding missing benchmarks, there was one that measured destructuring whose results where alarmingly high:

;; Destructuring a sequence
[v (into [] (range 1000000))], (loop [[x & xs] v] (if-not (nil? xs) (recur xs) x)), 10 runs, 3302 msecs

After profiling where the time was being spent, one of the sources was the calling of first and rest on the vector (which ends up being a chunked seq actually). Therefore it seemed like a good idea to explore other underlying implementatoins, instead of using the array data structure that comes with Erlang.

@jfacorro
Copy link
Member Author

Here is a very nice series of posts explaining in detail the Clojure vector implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant