[Issue 2313] Poor array ~= append performance

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 26 07:41:54 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2313





------- Comment #1 from lio+bugzilla at lunesu.com  2008-08-26 09:41 -------
Some stats. Using bearophile's test program from the original post in
newsgroup, with n = 100_000_000:

dmd v2.018 -O -inline -release

Default Phobos: 10,72 seconds
Commented gc.d line 915: 4,26 seconds
Replaced line 915 with memcpy: 5,63 seconds

Line 915 is:
#    x.ptr[length * sizeelem .. newsize] = argp[0 .. sizeelem];
where both x and argp are byte[]

Why is byte[] = byte[] slower than memcpy? Perhaps that array assignment should
also be part of the run-time library, perhaps just using memcpy?


-- 



More information about the Digitalmars-d-bugs mailing list