Why does scope(success) have to use exceptions?

monarch_dodra monarchdodra at gmail.com
Thu Jan 17 09:20:56 PST 2013


On Thursday, 17 January 2013 at 16:05:05 UTC, Maxim Fomin wrote:
>
> DMD should optimize, but I was arguing that in this situation 
> it should not do this.

I *love* D's "scope".

It re-organizes some of the ugliest code I have ever seen into 
really beautiful code.

However, having used it inside code that needs to run as fast as 
possible, I can tell you it is scary slow. As a matter of fact it 
was so scary slow one might even call it ridiculous. It *needs* 
to be improved if it wants to be taken seriously.

For non-inner loops, or non performance oriented operations, such 
as closing file hands, or for SQL transactions, I think it is 
fine.

However, don't use it in a loop. In particular, don't use it 
while decoding UTF!


More information about the Digitalmars-d mailing list