snazzy-d / sdc

The Snazzy D Compiler
MIT License
246 stars 55 forks source link

Use `dmd -run` instead of `rdmd` #327

Open 0xEAB opened 10 months ago

0xEAB commented 10 months ago

Experiment: replace rdmd with dmd -run

Opinions? Please, let me know if I broke something.

0xEAB commented 10 months ago

Suspicious enough, it passes the CI tests (unlike other PRs)…

deadalnix commented 9 months ago

I'm just seeing this now, because github's UI is nothing short of complete garbage. Let me try this.

deadalnix commented 9 months ago
rdmd -m64 -Isrc -w -debug -g -unittest -i --extra-file=src/config/build.d --extra-file=src/config/hash.d --extra-file=src/config/heap.d --extra-file=src/config/jsonparser.d --extra-file=src/config/map.d --extra-file=src/config/traits.d --extra-file=src/config/value.d --eval="assert(true)"
27 modules passed unittests

vs

dmd -m64 -Isrc -w -debug -g -unittest -i -main -run src/config/build.d src/config/hash.d src/config/heap.d src/config/jsonparser.d src/config/map.d src/config/traits.d src/config/value.d
25 modules passed unittests

Where does the difference come from?

deadalnix commented 9 months ago

It also seems to be significantly slower. I get 4s for the former vs 7s for the later.

maxhaton commented 9 months ago

It also seems to be significantly slower. I get 4s for the former vs 7s for the later.

When invoked from the makefile or a raw command? If the former then it may be because rdmd caches and dmd -run obviously won't.

deadalnix commented 9 months ago

Invoked raw, but it doesn't change anything, from the makefile, the targets are phony anyways.

You are right it's probably due to caching.

0xEAB commented 9 months ago

Where does the difference come from?

Given the performance regression, is it still worth investigating the difference in the number of tested modules?

deadalnix commented 9 months ago

I'm not sure. I'm still very curious to know why the test count doesn't match, this is very bizare.

0xEAB commented 8 months ago

I guess, https://github.com/dlang/dmd/pull/15795 would be useful here

deadalnix commented 8 months ago

Yes, at least we'll be able to identify what the changes are and if they are bad or not. Ideally, we'd like to runt the tests from the modules we pass explicitly, and only these (that's not at all what dmd/rdmd are doing).

maxhaton commented 8 months ago

Yes, at least we'll be able to identify what the changes are and if they are bad or not. Ideally, we'd like to runt the tests from the modules we pass explicitly, and only these (that's not at all what dmd/rdmd are doing).

Hopefully that other PR I made to enable that behaviour can get merged...