Typical security issues in C++: why the GC isn't your enemy

Walter Bright newshound2 at digitalmars.com
Mon Dec 12 02:48:15 UTC 2022


On 12/9/2022 2:49 PM, deadalnix wrote:
> I would suggest that the way to was done probably wasn't the right way. Knowing 
> how DMD works, I suspect this is done on an AST representation, and this is 
> definitively hard to do it on such representation. This is much easier to do on 
> an SSA or Sea of Node style representation.
> 
> It's fairly easy to convince oneself this is fast, any modern JIT does it.

D's optimizer runs on the intermediate code, not the AST. It's as fast as it's 
going to get, but is still slow enough that the optimizer is enabled only with a 
switch.

(The optimizer was built in the DOS days, and you can bet I spent a great deal 
of time trying to speed it up. It had to work in reasonable time for 16 bit 
computers. It uses the bit vector approach, recommended by Hennessy&Ullman for 
optimization algorithms.)

Modern jits work on demand (that's why they're called "Just In Time"), one 
function at a time, which spreads the time spent optimizing out to the point 
where one doesn't notice it so much. A native compiler does the *entire program* 
at the same time.


More information about the Digitalmars-d mailing list