Speculative: Rust for base system components

Brian Neal brian at aceshardware.com
Fri Jan 4 16:50:22 UTC 2019


Sure!

Just go to http://godbolt.org/ and type a small program in each language, enter the appropriate compilation flags and compare the output. The function I used took a count as a parameter, iterated through the count, summed up odd numbers and returned the sum.

Cheers,

-Brian

Sent from my iPhone

> On Jan 4, 2019, at 3:02 AM, Alejandro Martinez <unledev at gmail.com> wrote:
> 
> Hi Brian,
> 
>> On Tue, Jan 1, 2019 at 7:02 AM Brian Neal <brian at aceshardware.com> wrote:
>> 
>> It was a debug build with no optimization for either compiler. But we
>> can easily run a variety of settings for comparison:
>> 
>> Compiler              Flags                 Inst. Count Build Time
>> ======================================================================
>> clang 7.0.0           none                           33 296ms
>>                       -O3                            23 341ms
>> rustc 1.31.0          none                          110 606ms
>>                       -C opt-level=3                 67 643ms
>> gcc 8.2               none                           37 211ms
>>                       -O2                            24 249ms
>>                       -O3                          119* 206ms
>> 
>> * With -O3, gcc unrolled and vectorized the loop. The other compilers
>> did not emit vectorized code at any of the standard optimization levels.
>> 
>> So, essentially, double the build time and ~3 times the code for the
>> same logic.
> 
> Can you share your exact tests so others can replicate?
> 
> Thanks,
>  Alex
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2267 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20190104/94ade291/attachment.bin>


More information about the freebsd-hackers mailing list