Array Appending and DRuntime

2009-04-25 Thread dsimcha
For a while now, I've had a suspicion that the builtin array appending has gotten slower lately. The talk about array appenders here lately has brought that to a head, so I decided to test it and find out. Here's the test program I used: import std.stdio, std.perf; void main() { scope pc =

Re: Array Appending and DRuntime

2009-04-25 Thread dsimcha
== Quote from dsimcha (dsim...@yahoo.com)'s article > 2. gcx.d appears to cache the last block size query. This means that > repeatedly querying the same block in a single threaded program (where > thread_needLock() returns false and no lock is necessary) is very fast. This > is true in both the

Re: Array Appending and DRuntime

2009-04-25 Thread bearophile
dsimcha: > DMD 2.019 (Last release before druntime): 42 milliseconds. > DMD 2.020 (First release with druntime): ~1000 milliseconds. > DMD 2.029 (Current version): ~1000 milliseconds. > DMD 2.029 (Replacing ~= with the Appender struct): 18 milliseconds. > DMD 2.029 (Replacing builtin array with

Re: Array Appending and DRuntime

2009-04-25 Thread Andrei Alexandrescu
bearophile wrote: dsimcha: DMD 2.019 (Last release before druntime): 42 milliseconds. DMD 2.020 (First release with druntime): ~1000 milliseconds. DMD 2.029 (Current version): ~1000 milliseconds. DMD 2.029 (Replacing ~= with the Appender struct): 18 milliseconds. DMD 2.029 (Replacing builtin

Re: Array Appending and DRuntime

2009-04-25 Thread bearophile
Andrei Alexandrescu: > I'm not sure on what machine you test, but on my (crappy old) laptop, > your Appender example completes in 4.95 seconds. Are you sure you are > measuring the right thing? My purpose is to have a good standard library and a good language. Errors of mine are always possible.

Re: Array Appending and DRuntime

2009-04-25 Thread Andrei Alexandrescu
bearophile wrote: Andrei Alexandrescu: I'm not sure on what machine you test, but on my (crappy old) laptop, your Appender example completes in 4.95 seconds. Are you sure you are measuring the right thing? My purpose is to have a good standard library and a good language. Errors of mine are a

Re: Array Appending and DRuntime

2009-04-25 Thread dsimcha
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article > bearophile wrote: > > Andrei Alexandrescu: > >> I'm not sure on what machine you test, but on my (crappy old) > >> laptop, your Appender example completes in 4.95 seconds. Are you > >> sure you are measuring the right thi