On Tue, 2 Oct 2001, Daniel Joyce wrote:
Or, perhaps, change sorted collection so it uses Skip Lists, etc, as backing stores when certain conditions are met ( Usually size of data stored ). With a little code profiling, one could tune it to change it's backing data rep at the appropiate times as the data stored grows.
This is done in some Smalltalks.
Make it a drop-in replacement. It is quite a bit more expensive; let the programmer figure out that it is needed through profiling, and make the drop-in replacement.
Any automatic conversion is probably a bad idea. Sometimes, memory is more important than speed, sometimes the reverse; a lot of things will affect the relative differences between them.
Scott