How do people feel about putting source compiler directives inside rdmd?

Petar Petar
Tue Dec 3 16:33:32 UTC 2019


On Tuesday, 3 December 2019 at 13:07:04 UTC, aliak wrote:
> On Tuesday, 3 December 2019 at 09:10:16 UTC, Petar Kirov 
> [ZombineDev] wrote:
>> On Monday, 2 December 2019 at 21:43:17 UTC, bachmeier wrote:
>>> On Monday, 2 December 2019 at 20:04:17 UTC, aliak wrote:
>>>
>>>> Dub is painfully slow for scripting
>>
>> On the contrary, I think it's great for what it offers.
>> I just made a quick test and it contributed to to 0.3sec slow 
>> down, compared to `dmd -run` of minimal D script (0.21sec vs 
>> 0.51sec). I think that could be improved, but still it's a 
>> small price to given its feature set. There's no alternative 
>> tool for D that empowers single-file scripts to use 
>> third-party libraries with zero fiddling with import paths, 
>> dependency downloading, build order, linking and so on.
>
> The script I run takes over a second each invocation (when 
> doing nothing). With rdmd that happens once and then it uses 
> the same binary (and is instant).
>
> Do you know if dub caches the binary? If it does then it's just 
> dependency checking. And if that can be turned off then I 
> believe the experience can be satisfactory. But right now it's 
> painful.

Dub is supposed to cache every build artifact, but for some 
reason the `isUpToDate` function returns `false` for a 
single-file package I am testing with.

BTW, on what OS and hardware are you testing?
I am on Linux with an SSD, so this may explain why I get faster 
results than you.

Dub has everything necessary to reach execution time parity up 
+/- 5% with rdmd.
The dependency checking is relatively fast for me, but if 
necessary that can be easily disabled, using the 
`--skip-registry` option.
If it's not already like that IMO dub shouldn't check for updates 
for single-file packages. For projects with dub.selections.json 
AFAIK it doesn't check for updates if dub.selection.json contains 
the versions of transitive dependencies and they had already been 
fetched.

I'll look into the problem with Dub's `isUpToDate`.


More information about the Digitalmars-d mailing list