Speeding up DCD in big projects

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Jul 21 17:32:39 UTC 2020


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.


T

-- 
Век живи - век учись. А дураком помрёшь.


More information about the Digitalmars-d mailing list