3 ms·
I think it would be fun to think of this in a more high-level language where data structures could be autonomously tuned by a VM or interpreter. That way, you
by tom_b 15y ago
I think it would be fun to think of this in a more high-level language where data structures could be autonomously tuned by a VM or interpreter.
That way, you could start out with lists when prototyping and building up your app, but under the covers, at runtime, your underlying data structure could swap into something else that optimized your usage pattern. I also think that although this idea sounds fun, that it is premature optimization of the worst kind.
I do think that the idea of Perflint, where you do a little profiling up front as the dev, is much better than trying to use some embedded heuristics. Probably just realizing that its worth doing a little "real world data size" testing makes something Perflint valuable.
- protomyth 15y agoI do believe there are some smalltalks that do this.
- lmz 15y agoApple's CFArray does some of this. It can have different implementations depending on the number of elements in it.[1] I don't think it observes the usage pattern yet. [1]: http://ridiculousfish.com/blog/archives/2005/12/23/array/ http://ridiculousfish.com/blog/archives/2005/12/23/array/