Le Thu, Nov 09, 2023 at 06:20:44PM +0100, Landry Breuil a écrit :
> Le Thu, Nov 09, 2023 at 05:54:33PM +0100, Caspar Schutijser a écrit :
> > Hi all,
> > 
> > Below is a diff for bsd.port.mk that allows us to set USE_SCCACHE=Yes
> > in /etc/mk.conf to use sccache. Manual page updates are included,
> > which I copied and adapted from the ccache bits.
> > 
> > Note that with the diff below, sccache is only used for Rust code,
> > not for C/C++ (which sccache also supports). So at least at this
> > moment, USE_CCACHE=Yes and USE_SCCACHE=Yes don't bite each other
> > (ccache will cache C/C++ compilation results, sccache will cache
> > Rust compilation results). This may change later if we want to use
> > sccache for C/C++ too, which at the moment does not work yet.
> > 
> > Another thing to note is that sccache uses a client-server model;
> > quote from the README:
> > 
> > > sccache works using a client-server model, where the server runs
> > > locally on the same machine as the client. The client-server model
> > > allows the server to be more efficient by keeping some state in
> > > memory. The sccache command will spawn a server process if one is
> > > not already running, or you can run sccache --start-server to start
> > > the background server process without performing any compilation.
> > > 
> > > You can run sccache --stop-server to terminate the server. It will
> > > also terminate after (by default) 10 minutes of inactivity.
> > 
> > So don't be surprised if a sccache process is still running when
> > you hit ^C on the compilation process.
> > 
> > I have used this now for quite some time and I didn't find any
> > problems so far. Comments or OKs?
> 
> definitely OK, some numbers from compiling (coming from cargo itself):
> sysutils/eza:
> - without cache 3m 53s
> - rebuild with cache populated 1m 15s
> 
> devel/sccache itself:
> - without cache 29m 36s
> - rebuild with cache popuplated 4m 48s
> 
> currently populating the cache for www/mozilla-firefox to see how much
> we gain..

adding more positive feedback, i rebuilt firefox 120.0beta8 twice, first
with sccache empty, second with sccache populated, and both builds were
with ccache populated for C/C++ compilation units:

those are the numbers from cargo builds, eg timing improvements for rust
bits build only:
[22:05] moz:~/ $grep 'Finished release' mystuff/www/mozilla-firefox/build1.log
    Finished release [optimized] target(s) in 36m 44s
    Finished release [optimized] target(s) in 3m 08s
    Finished release [optimized] target(s) in 46.99s
[06:09] moz:~/ $grep 'Finished release' mystuff/www/mozilla-firefox/build2.log
    Finished release [optimized] target(s) in 10m 17s
    Finished release [optimized] target(s) in 2m 25s
    Finished release [optimized] target(s) in 21.98s

the complete 'time make package' operation took 85m34.08s real while on
the same VM it's usually between 120 and 180 minutes. So... a much
welcome improvement for my workflow, and every rust port build will
definitely benefit from sccache...for a reasonable storage tradeoff.

23.3G   /usr/obj/ports/.ccache
619M    /usr/obj/ports/.sccache

Landry

Reply via email to