Optimizing Java using D

Wanderer via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 5 07:02:13 PDT 2014


On Friday, 4 July 2014 at 12:18:54 UTC, Daniel Murphy wrote:
> Yes they do.  
> http://en.wikipedia.org/wiki/Database_index#Clustered
>
> You can obviously only do that for one index.

Ugh, and what happens in such hypothetical database if you update 
its first row so it becomes 1 byte longer than before? Total 
reordering of the whole database just to maintain that index? 
That's very similar to the issue I posted above - wasteful 
shuffling of big amounts of memory only because D's structs don't 
support indirection by their nature, and you can't swap two 
elements without copying their whole contents.

John Colvin said above that structs can be useful, even together 
with sorting (and similar algorithms), if they are relatively 
small. This is true, but this design is not scalable. As soon as 
your program evolves and your struct grows with more and more 
fields, D's sort on it becomes slower and slower, proportionally 
to the struct's size. That's not the best behavior IMHO.


More information about the Digitalmars-d mailing list