Array append performance
Bill Baxter
wbaxter at gmail.com
Sat Aug 23 11:07:05 PDT 2008
On Sun, Aug 24, 2008 at 2:16 AM, Steven Schveighoffer
<schveiguy at yahoo.com> wrote:
> "dsimcha" wrote
> I see nothing wrong with having a library solution to this. D and
> especially D2 is to the point where syntax of custom structs is really easy
> to use.
>
> The problem is that many times I don't append to an array or slice, why
> should I have to accept the cost of an extra 4-8 byte field for every slice
> and array that isn't going to change size (which I would argue is used more
> often)?
Personally I'd argue that appending efficiently is important to more
programs than than saving 4-8 bytes here and there. So that would
suggest that lean-and-mean fixed-sized arrays should be the library
solution, and arrays with a capacity field should be the built-in
type.
--bb
More information about the Digitalmars-d
mailing list