Open jonahbeckford opened 10 months ago
This is related to #5741
That indeed looks related to this as opam exec --
reads a couple files (to lead the switch state). Do you have any idea what could be different from Unix-likes when reading files?
Speed test for my mac M1 (the green numbers on right hand side are statistically accurate; ignore the speedometers which are just a snapshot of fluctuations):
And for my Windows drive Y:
which is where I have my current opam root
and opam switch
.
So, in the numbers I am reporting the mac M1 mini drive is significantly faster. (I have a Z:
drive that is faster than the mac M1, but I don't use that for opam. And I expect my slower Y:
drive is more typical for average Windows users so I'll focus on my Y:
drive.)
I realized that this issue (not #5741 though) I had measured using Windows Sandbox. The opam root would have been a virtualized file system; that is not representative. So, in the table below you'll see numbers from my Y:
drive ... the same drive I attached disk speed numbers.
Times rounded to the nearest tenth of a second. The opam-real
is regular opam executable without any DkML shims.
Time | What | Where |
---|---|---|
0.2s | measure-command { opam-real --version } |
Windows |
0.1s | time opam --version |
M1 |
0.3s | measure-command { opam-real var --global } |
Windows |
0.1s | time opam var --global |
M1 |
0.0s | measure-command { C:\Windows\System32\where.exe /? } |
Windows |
0.0s | time /usr/bin/true |
M1 |
0.2s | measure-command { opam-real exec -- C:\Windows\System32\where.exe /? } |
Windows |
0.1s | time opam exec -- /usr/bin/true |
M1 |
Conclusion:
opam exec
for commonplace SSD drives. It becomes very noticeable for slower I/O.I think this is lower priority but given that students especially are often on older Windows hardware (and definitely not SSDs), this hit will be noticeable for a significant fraction of new users.
Something like the following is instantaneous:
But the following (
opam exec -- C:\Windows\System32\where.exe /?
) visibly pauses for at least one second before executing the command:I get this one second pause with
opam var
as well.This is related to https://github.com/ocaml/opam/issues/5741