|
|
Log in / Subscribe / Register

Reasons for speedup?

Reasons for speedup?

Posted Feb 12, 2025 20:53 UTC (Wed) by roc (subscriber, #30627)
In reply to: Reasons for speedup? by NYKevin
Parent article: Rewriting essential Linux packages in Rust

Sprinkling 'restrict' through in your C code is not even an option; it would be a disaster. Sooner or later you're going to accidentally violate the restrict constraint, the code will start misbehaving in weird ways (but only with certain optimization levels and compilers), and since no sanitizers address this feature, you'll have a nightmarish time trying to figure out the bug.

For this reason and others, the performance ceiling for single-threaded Rust code is potentially quite a bit higher than for similar C or C++ code. A lot more compiler work is needed though.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds