Open folkertdev opened 10 months ago
Have you tried turning off your virus scanner?
Also, so far this has not demonstrated any caching failure, since you only built the library once. How long does it take the second time?
Can confirm the behavior with multiple runs (with a warmup run to populate the cache):
Benchmark 1: zig build-lib .\app.obj .\bitcode.obj -lc -dynamic -femit-bin=output
Time (mean ± σ): 1.002 s ± 0.151 s [User: 0.282 s, System: 0.726 s]
Range (min … max): 0.880 s … 1.197 s 10 runs
Benchmark 2: zig build-lib .\app.obj .\bitcode.obj -lc -femit-bin=output
Time (mean ± σ): 24.5 ms ± 11.8 ms [User: 10.4 ms, System: 17.6 ms]
Range (min … max): 19.6 ms … 103.2 ms 71 runs
Summary
'zig build-lib .\app.obj .\bitcode.obj -lc -femit-bin=output' ran
40.95 ± 20.60 times faster than 'zig build-lib .\app.obj .\bitcode.obj -lc -dynamic -femit-bin=output'
Thanks!
Have you tried turning off your virus scanner?
I have tested without the Windows real time protection active and there is no change. Otherwise I have no other virus software running on this machine.
Also, so far this has not demonstrated any caching failure, since you only built the library once. How long does it take the second time?
EDIT: I hadn't noticed @squeek502 benchmark
Zig Version
0.11.0
Steps to Reproduce and Observed Behavior
We are seeing very slow dynamic library creation on windows. For instance
That is
1793ms
for a dynamic library, vs just81ms
for a standard static one. It looks like (but the message moves too quickly) zig is building some sort of mingw artifact (perhaps because of-lc
). The building of this artifact is not cached, so happens every time.To reproduce, download the zip file slow-dylib.zip. In it are two object files. Then run
that should reproduce the timings shown earlier.
Expected Behavior
For dynamic library creation (with very small inputs) to complete in reasonable time, maybe by caching more expensive work if needed.