Why is Rails boot so slow on macOS?

I ran a ruby-prof around a single run of Random Read test. Comparing macOS vs a VM on macOS:

macOS

Ubuntu VM on macOS

On the VM random_file is 22% of the time, compared to 4% on macOS. Assuming they take the same real world time on both VM and macOS then it suggests Class::IO#read is 5x slower on macOS?

2 Likes