ROOT starts up slow for me on my Mac running Sierra 10.12.4. It takes 5+ seconds to start whether I am running a script or even compiled code. I am using the precompiled Homebrew builds and encounter the issue in both versions 6.08/06 and 5.34/36.
# root 6
> % time root -b -l -q
root [0]
root -b -l -q 0.22s user 0.06s system 5% cpu 5.276 total
# root 5
> % time root -b -l -q
root [0]
root -b -l -q 0.13s user 0.03s system 3% cpu 5.157 total
With compiled code:
> % time ./liveProton data_simplified/spill_67.root
# ...
./liveProton data_simplified/spill_rs67.root 0.35s user 0.07s system 7% cpu 5.620 total
On a remote server running Scientific Linux Fermi 5.4 with Root 5.34/32, it starts up in less than 1 second.
$ time root -l -b -q
root [0]
real 0m0.207s
user 0m0.150s
sys 0m0.044s
$ time ./liveProton data_simplified/spill_67.root
# ...
real 0m0.465s
user 0m0.440s
sys 0m0.023s
The suggested solutions in the various threads I’ve found do not work for me – e.g. disconnecting from network / adjusting DNS, or setting system HostName via scutil --set HostName <hostname.local>.
Thanks for providing the traces! I’ve tried again and again to reproduce this, and always failed Neither of the trace files provide relevant timing data; would you be able to run dtruss such that it includes durations or absolute time (if that’s possible)?
Apparently there is a hack that enables debug output for the DNS resolver, maybe that helps here:
Awesome! I don’t have time to recompile and test right now, but I just tried scutil --set HostName <hostname>, using hostname without the .local part e.g. Alex-MBA-2013 for me, and it works as expected now. So theoretically I would assume your fix should be sound.
> % time root.exe -l -b -q
root [0]
root.exe -l -b -q 0.13s user 0.05s system 95% cpu 0.184 total
For reference, to answer your previous question, I used sudo dtruss -deo root.exe -b -l -q .