Another performance problem

bearophile bearophileHUGS at lycos.com
Sun Dec 8 15:06:34 PST 2013


David Nadlinger:

> I did, however, find a rather severe bug: We emit the "__gshared
> static" globals in the MemoryPool struct as thread-local, which 
> is a)
> a big correctness problem, and b) might cause substantial 
> slowdown due
> to the additional overhead incurred when accessing them.

Usually not adding the "__gshared" annotation with DMD doesn't 
cause a significant slowdown of the code.



> Looking at the IR generated on Linux, I can't see any obvious 
> big
> performance issues (such as e.g. GC allocations where there 
> shouldn't
> be any), and indeed the code runs in < 1 s on my machine (can't 
> test
> on Windows right now).

DMD:
http://codepad.org/8e6RCzlz

LDC2:
http://codepad.org/r2eYIOKg

Bye,
bearophile


More information about the digitalmars-d-ldc mailing list