Root slow to start on Mac OS

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

How can I troubleshoot this?

This has been mention before, see this post.

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>.

Here are some logs…


Thanks for providing the traces! I’ve tried again and again to reproduce this, and always failed :frowning: 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:

sudo -i
echo 'OEA' > /etc/.mdns_debug
root.exe -l -b -q

and post the output here. Don’t forget to disable the DNS debug output again:

sudo rm /etc/.mdns_debug

If you are at CERN we can also have a look at it together.


Here’s the dtruss output with timing and DNS logs:

I’m not at CERN.

How did you run this, could you paste the command? Then I can compare with output from my MacBook which doesn’t show this lag. Thanks!

Never mind, I got it. It’s your hostname which is configured as Alex-MBA-2013.local. That “local” part is causing the problem.

It’s fixed in the master. Could you confirm?

Thank you so much for your help with diagnosing this. This was a long-lasting issue that we never managed to track down!


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 .

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.