[phobos] Clear appending cache?

Steve Schveighoffer schveiguy at yahoo.com
Fri Nov 19 04:35:03 PST 2010





----- Original Message ----
> From: Andrei Alexandrescu <andrei at erdani.com>

> On the contrary, I want to make  Appender as unnecessary as possible, and ~= as 
>efficient as possible without  requiring the use of  Appender.

An array is 2 fields, length and pointer.  There is no room for another field, 
so the lookup of the block size and embedded length is necessarily complex and 
time consuming.  Not only that, but an array may not be the owner of its data.  
The lookup must answer two questions:

1. Is there enough room in the block I can extend into?
2. If I extend, will I overwrite data that is being used elsewhere?

Without more fields in the array type, I don't see how it's possible to make it 
as fast as Appender, and I very much do not want to try and add more fields to 
an array, 2 words is a perfect size.  Do you have any ideas on how it can be 
faster?

-Steve



      


More information about the phobos mailing list