Speculative: Rust for base system components

Garance A Drosehn gad at FreeBSD.org
Tue Jan 1 00:26:30 UTC 2019


On 31 Dec 2018, at 17:44, Garance A Drosehn wrote:

>> On Mon, Dec 31, 2018 at 12:17 AM Conrad Meyer <cem at freebsd.org> wrote:
>>
>> Do you have any data to support the claim of slow build times?
>> I know it's very hard to do an apples-to-apples comparison of build
>> times between different languages, but I would be interested to see
>> somebody try.
>
> I know that it takes a very long time to build rust (the compiler
> itself) on my mac, and FreeBSD's buildworld always starts out by
> building the compilers that it needs.  So adding rust to the base
> system is going to cause an immediate and noticeable increase in
> the time used by buildworld.


> On 31 Dec 2018, at 9:21, Igor Mozolevsky wrote:
>>
>> Does the generated code size increase or decrease and does the
>> data-path get longer or shorter with switch from C to Rust with
>> all the "great features" of Rust?  Are there any metrics for
>> these?  If a CPU cache gets trashed repeatedly or data takes
>> massive detours that would be a significant downside, wouldn't it?
>
> I've been somewhat interested in Rust for awhile, although I haven't
> had the time to do much of anything with it.  Part of the answer to
> your questions will depend on how good the programmers are.

There's two questions wrt performance.  One is how long it takes
to compile some program, and then the other is how fast the
code is which is produced by the compiler.  A note on both of
those:  Rust has the notion of "building for release", in which
case the compile-time step takes *much* longer, but all that
extra time goes into producing better code in the resulting
program.

So if you think the compiler is fast but that it's generating very
slow programs, then it might be that you're not doing "a release
build".

There's one program written in rust which I use a lot, which is
called 'ripgrep' (or 'rg' for short).  It's one of the few programs
which I install via pre-compiled pkgs, because I don't want to wait
for all the time it takes to compile a release-build.  But I'm very
happy with how fast the program runs.

--
Garance Alistair Drosehn                =     drosih at rpi.edu
Senior Systems Programmer               or   gad at FreeBSD.org
Rensselaer Polytechnic Institute;             Troy, NY;  USA


More information about the freebsd-hackers mailing list