On 8/29/12 2:51 PM, Karl Tomlinson wrote:
On 8/22/12 6:10 AM, Robert Kaiser wrote:
[...]
esp. given that basic file I/O is often costly (from watching my CPU
usage, a lot of the build time is spent in I/O wait when using spinning
disks - SSDs improve that hugely).
On Wed, 22 Aug 2012 12:29:24 -0700, Gregory Szorc wrote:
Yes, I/O wait can significantly reduce build times. I recommended
at [1] that aside from a modern CPU, investing in an SSD is the
best thing you can do for build times. If a build machine doesn't
have an SSD, it's effectively throwing away CPU cycles in I/O
wait. It's true that the build system today wastes a lot of CPU
cycles due to inefficient use of all available cores (lack of wide
parallelism due to recursive make). But, the efficiency should
rise drastically with our build system improvements. That will
make the impact of an SSD even more pronounced. On my MBP (with
8GB), building with an SSD reduced overall build time by a few
minutes, with libxul linking going from ~55s to ~5s. That's
without any build system changes! There is no doubt in my mind
that SSDs are worth the investment.
[1] http://gregoryszorc.com/blog/2012/07/29/mozilla-central-build-times/
This sounded good to me, so before searching for an SSD, I did
some experimentation.
Although suggested in Gregory's blog, I want to say more clearly
that if you have a filesystem designed for performance and enough
page cache then an SSD will not make any significant difference to
warm build times. The filesystem will perform the I/O
asynchronously and so I/O is not the limiting factor in build
times.
On this test system with a 1.6GHZ 4-core i7 and 16GB RAM, a gcc
4.5.3 64-bit debug build from scratch takes 23-24 minutes, whether
on a tmpfs ramdisk or magnetic disk with ext4 data=ordered.
libxul link times are 14s on each disk.
For warm build times, this is expected. In the measurements I performed
in January, I concluded that you needed ~9GB of memory on Linux to avoid
page cache eviction and thus incur no device I/O during builds [1].
If you have 9+GB of memory dedicated to building mozilla-central and you
are doing warm builds all the time, great, you probably don't need an
SSD. But, those conditions are specialized. You have to get things into
the page cache. That's a few GB of source files, the object files,
ccache files, etc over thousands of files. That's a lot of I/O and a lot
of potential for I/O wait. You also have everything else on your
computer contending for that page cache's memory.
Essentially if you have a server that does nothing but build
mozilla-central all day, you are probably fine without an SSD. (Note
that Mozilla's build infra doesn't qualify because AFAIK the machines
are rebooted after every build, purging the page cache in the process.)
If you are building on your everyday computer which is also running a
window manager, Firefox, etc, you'll likely have more page cache
eviction and slower build times assuming I/O wait isn't short.
FWIW, my build-splendid branch [2] now incorporates the psutil Python
package to measure system resource usage during builds. Every 0.5s it
records the I/O, memory, and CPU counters. At the end of the build, it
correlates build events (configure, js, nspr, export, libs, app, etc)
with resource usage and prints a summary. It paints an extremely
detailed picture of how system resources are being used during builds.
This data has already taught me a lot about where the inefficiencies in
the existing build system are. I'm hoping to get it checked in so others
can also produce data. And, once enough data is being produced, we
should be able to start drawing statistically sound correlations between
things like build times and I/O wait.
[1]
https://groups.google.com/forum/#!topic/mozilla.dev.builds/FJclsTA_OBQ/discussion
[2] https://github.com/indygreg/mozilla-central/tree/build-splendid/
[3]
https://github.com/indygreg/mozilla-central/blob/build-splendid/python/mozbuild-bs/mozbuild/util.py#L82
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform