Regarding the proposed Binray Literals Deprecation

Adam D Ruppe destructionator at gmail.com
Sat Sep 10 12:02:57 UTC 2022


On Saturday, 10 September 2022 at 07:03:21 UTC, Daniel N wrote:
> Personally I think anything which WAS a language feature should 
> be in object to keep the feature working out of the box. Not 
> sure why people are so afraid to use it, not often you have to 
> read object.d source, as long as it's just one file, it will be 
> blazingly fast as always.

object isn't actually blazingly fast. Its growth at least appears 
to be responsible for much of the slowdown of basic builds 
compared to the older D1 era builds.

I'm not sure exactly why though, if it is growth per se, or the 
use of several internal imports causing slowdowns, or specific 
implementation techniques, but if you zero out the object.d it 
does speed up builds.

Though I will concede it tends to be a smaller percentage as the 
program grows, it still imposes a baseline cost to each compiler 
invocation so we might want to keep an eye on it.

Another aspect is that object is implicitly imported so you get 
things in the global namespace. The module system has ways to 
disambiguate it, but I still just generally prefer the explicit 
import to keep it clear especially since the error messages can 
be fairly poor without import to clean it up.

But then you get the ergonomic issue of having to import it.


More information about the Digitalmars-d mailing list