Buildworld and tmpfs

I have recently been tracking stable from source and looking for ways to improve the time it takes to buildworld. I'm already using devel/cchace4 and option WITH_META_MODE=YES

I have seen some references on using tmpfs to leverage the speed of RAM. I have some questions about this as I am not sure if it will improve the process:

  1. Is this still recommended? Most of references come from very old posts.
  2. Updating from source requires rebooting before installing world, which will result in loosing whatever is in RAM. How do you overcome this?
  3. Will the use of tmpfs undermine the performance of cchace and META_MODE?
 
I use the very same setup and have the same question. During the build I see that my RAM usage is about ~1GB and I have about 10 or 12 GB that are either inactive, laundry or free. I guess I could make use of tmpfs(4) in order to speed things up a little bit. Probably, that size of RAM would not be enough to build everything entirely in memory, but maybe just some things. And I also wonder how can reboot after building the world done if we I use tmpfs? As I understand, with META_MODE we can't use tmpfs for /usr/obj, since along with object files we have .meta files there, which are needed for incremental builds.
 
Is this still recommended?
It was never recommended. At most it's been suggested leveraging tmpfs(4) to speed up the process. But as you already found out it has a big caveat.

And I also wonder how can reboot after building the world done if we I use tmpfs?
You don't. Because tmpfs(4) will be empty after the reboot, so all your built files are gone.
 
More Cores improves BuildWorld Speed. 24 core/ 48thread Threadripper 9960X does buildworld in under 10 minutes.
 
More Cores improves BuildWorld Speed.
Oh yeah, I knew that number of cores is primary factor, but since I can't increase that right now, I wanted to dedicate and utilize as much resources (RAM) as I can.
24 core/ 48thread Threadripper 9960X does buildworld in under 10 minutes.
Wow, that's even too fast! :) My buildworld is done in ~1h 50min, which is more than enough for me.
 
More Cores improves BuildWorld Speed. 24 core/ 48thread Threadripper 9960X does buildworld in under 10 minutes.
Yep and more memory helps. tmpfs using memory to store temp files vs more ram to actually work, I'll take more physical RAM, more cores (even at lower clock rate).
I think the only place that tmpfs may help is the downloading of distfiles. The "make fetch" portion. Granted this applies more to building ports than world, but maybe there is an equivalent in world (I don't think so)
 
Oh yeah, I knew that number of cores is primary factor, but since I can't increase that right now, I wanted to dedicate and utilize as much resources (RAM) as I can.

My buildworld is done in ~1h 50min, which is more than enough for me.

Well, thats a long time, None of my systems uses more than 50 minutes. the 4 core Kabylake machine Shuttle SH170R6 is the worst.
HDD vs SSD of course is ofcouse a factor that may slow a system down , are you at liberty to reveal the Hardware config of this machine that uses 110 minutes on buildworld ?
 
1h50mins is enough time for a good lunch, under 10 minutes is half a cup of coffee, 50 minutes is maybe a cigarette or two.
 
Well, thats a long time, None of my systems uses more than 50 minutes. the 4 core Kabylake machine Shuttle SH170R6 is the worst.
I didn't build that box specifically for building purposes, that's just my old PC which I don't use now, so I decided to utilize it somehow.

are you at liberty to reveal the Hardware config of this machine that uses 110 minutes on buildworld ?
Yes, sure.
Code:
CPU: Intel(R) Core(TM) i3-8350K CPU @ 4.00GHz (4000.00-MHz K8-class CPU)
nda0: <Samsung SSD 970 EVO Plus 500GB 2B2QEXM7 S4EVNF0M669128F>
real memory  = 17179869184 (16384 MB)
 
IIRC the speedup from tmpfs is only about 1% or so. The reason I've used tmpfs is to reduce the impact of the IO on a running desktop, reduce wear on the drive and reduce noise.
 
With the advent of SSDs any gaming around tmpfs has reduced impact.

I just make /tmp a tmpfs and make sure intermediate compilation files are placed there.Alternatively you can use `cc -pipe ...`, but that takes more memory.
 
I just make /tmp a tmpfs and make sure intermediate compilation files are placed there.
That's what I'd like to do. But how to make only intermediate obj files go into /tmp, but all the resulting files - into /usr/obj? I couldn't find such option for buildworld or buildkernel in build(7), only MAKEOBJDIRPREFIX.
 
That's what I'd like to do. But how to make only intermediate obj files go into /tmp, but all the resulting files - into /usr/obj? I couldn't find such option for buildworld or buildkernel in build(7), only MAKEOBJDIRPREFIX.

You just set $TMPDIR to /tmp.

That won't place file that gotta be linked on /tmp, though.
 
With the advent of SSDs any gaming around tmpfs has reduced impact.

I just make /tmp a tmpfs and make sure intermediate compilation files are placed there.Alternatively you can use `cc -pipe ...`, but that takes more memory.

I might be misunderstanding this, but isn't '-pipe' the default anyway?

cd /usr/src ; make -V CXXFLAGS ; make -V CFLAGS
-O2 -pipe -fno-common
-O2 -pipe -fno-common

I don't see why '-pipe' would use more memory than writing temporary files into RAM.
 
I might be misunderstanding this, but isn't '-pipe' the default anyway?

cd /usr/src ; make -V CXXFLAGS ; make -V CFLAGS
-O2 -pipe -fno-common
-O2 -pipe -fno-common

I don't see why '-pipe' would use more memory than writing temporary files into RAM.

Oh. I guess it is. Some people might want to un-default that when they run out of memory.

That makes a tmpfs a pretty NOP.
 
No only for building ports
Code:
MYFLAGS="-fno-lto -O2 -pipe -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fno-short-enums -fexceptions -fident -fverbose-asm -fre
cord-gcc-switches -fvisibility=default -fomit-frame-pointer -fstrict-aliasing -Wall -Wextra"
#MYFLAGS=""
.if ${.CURDIR:M*/usr/ports*}
CFLAGS+="${MYFLAGS}"
CXXFLAGS+="${MYFLAGS}"
.endif
 
No only for building ports
Code:
MYFLAGS="-fno-lto -O2 -pipe -D_FORTIFY_SOURCE=3 -D_GLIBCXX_ASSERTIONS -fstack-protector-strong -fno-short-enums -fexceptions -fident -fverbose-asm -fre
cord-gcc-switches -fvisibility=default -fomit-frame-pointer -fstrict-aliasing -Wall -Wextra"
#MYFLAGS=""
.if ${.CURDIR:M*/usr/ports*}
CFLAGS+="${MYFLAGS}"
CXXFLAGS+="${MYFLAGS}"
.endif

Right, but are you running 15 or Current? It looks like no-common became the default in clang about 5 years ago, and it was already the default in gcc.
 
Back
Top