48

Can we make a Rust program that’s as small as it’s assembler equivalent?

top 3 comments
sorted by: hot top controversial new old
[-] Vorpal@programming.dev 13 points 9 months ago

That assembly program the author compares to is waay bloated. This guy managed with 105 bytes: https://nathanotterness.com/2021/10/tiny_elf_modernized.html (that is with overlapping part of the code into the ELF header and other similar level shenanigans). ;)

All kidding aside, interesting article.

[-] leanleft@lemmy.ml 1 points 9 months ago

i think nothing can outperform simple asm for simple operations.

[-] sugar_in_your_tea@sh.itjust.works 4 points 9 months ago

IDK, I'm not aware of all the fancy asm commands, but compilers are, so a good compiler will probably produce better code than me. For example, simple loops could turn into a set of SIMD instructions or be unrolled, while I'd naively do a jump loop.

this post was submitted on 18 Feb 2024
48 points (100.0% liked)

Rust

6064 readers
26 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS