Speeding up DCD in big projects

Steven Schveighoffer schveiguy at gmail.com
Tue Jul 21 17:37:48 UTC 2020


On 7/21/20 1:32 PM, H. S. Teoh wrote:
> On Tue, Jul 21, 2020 at 01:12:04PM -0400, Steven Schveighoffer via Digitalmars-d wrote:
>> On 7/21/20 1:02 PM, H. S. Teoh wrote:
> [...]
>>> I'm skeptical of "huge performance improvements" with nothrow in
>>> anything that involves disk I/O.
> [...]
>> If you look at the change, it's not the nothrow optimization that
>> Walter always talks about (where code that is marked nothrow performs
>> slightly better than code that isn't marked nothrow but doesn't end up
>> throwing), it's that the COMMON CASE was that an exception is thrown
>> and caught, and then bool is returned. Instead, just return the bool.
> [...]
> 
> Ahh I see.  That makes sense then.
> 
> Which also begs the question, *why* does it even throw in the first
> place.  The non-existence of a file is a normally-expected outcome of
> isFile/isDir, throwing in that case seems excessively heavy-handed.
> It's probably a case of bad API design.
> 

Agree. Returning false seems appropriate as something that doesn't exist 
is clearly not a file or directory.

-Steve


More information about the Digitalmars-d mailing list