2 ms·
Well, I have played around with this for some time and I found that boxing is just one reason. Another one is that clojure structs seem to always act as generic
by fauigerzigerk 17y ago
Well, I have played around with this for some time and I found that boxing is just one reason. Another one is that clojure structs seem to always act as generic maps even if only predefined elements are actually stored. This seems like an easy one to optimize.
But if I put lots of structs in a Java ArrayList, memory use goes down significantly, so clojure vectors are much less efficient regardless of boxing.
- pmjordan 17y agoHave you poked around the (Java) source for clojure's data structures? It's very readable, and if you have any ideas for improving their memory footprint, I think a lot of people (including myself) would appreciate hearing about them.