Content deleted Content added
Jerryobject (talk | contribs) →IDE support: Small WP:COPYEDITs WP:EoS: WP:TERSE, clarify. WP:LINKs: adds, update-standardizes. Nonlead-word nonproper noun MOS:CAPS > WP:LOWERCASE sentence case. |
Jerryobject (talk | contribs) →Performance: WP:REFerence WP:CITation parameters update-standardize: reorder. Adds: information, WP:REFerence WP:CITations, parameters, fills. |
||
Line 635:
Many of Rust's features are so-called ''zero-cost abstractions'', meaning they are optimized away at compile time and incur no runtime penalty.{{sfn|McNamara|2021|p=19, 27}} The ownership and borrowing system permits [[zero-copy]] implementations for some performance-sensitive tasks, such as [[parsing]].<ref>{{Cite book |last=Couprie |first=Geoffroy |title=2015 IEEE Security and Privacy Workshops |chapter=Nom, A Byte oriented, streaming, Zero copy, Parser Combinators Library in Rust |date=2015 |pages=142–148 |doi=10.1109/SPW.2015.31 |isbn=978-1-4799-9933-0 |s2cid=16608844 }}</ref> [[Static dispatch]] is used by default to eliminate [[method call]]s, except for methods called on dynamic trait objects.{{sfn|McNamara|2021|p=20}} The compiler also uses [[inline expansion]] to eliminate [[function call]]s and statically-dispatched method invocations.<ref>{{Cite web |title=Code generation |url=https://doc.rust-lang.org/reference/attributes/codegen.html |access-date=2022-10-09 |website=The Rust Reference |archive-date=2022-10-09 |archive-url=https://web.archive.org/web/20221009202615/https://doc.rust-lang.org/reference/attributes/codegen.html |url-status=live}}</ref>
Since Rust uses [[LLVM]], all performance improvements in LLVM apply to Rust also.<ref name="how-fast-is-rust">{{cite web |url=https://doc.rust-lang.org/1.0.0/complement-lang-faq.html#how-fast-is-rust? |title=How Fast Is Rust? |website=The Rust Programming Language FAQ |access-date=11 April 2019 |archive-date=28 October 2020 |archive-url=https://web.archive.org/web/20201028102013/https://doc.rust-lang.org/1.0.0/complement-lang-faq.html#how-fast-is-rust? |url-status=live}}</ref> Unlike C and C++, Rust allows for reordering struct and enum elements<ref>{{Cite book |last1=Farshin |first1=Alireza |last2=Barbette |first2=Tom |last3=Roozbeh |first3=Amir |last4=Maguire |first4=Gerald Q. Jr |last5=Kostić |first5=Dejan |year=2021 |url=https://dlnext.acm.org/doi/abs/10.1145/3445814.3446724 |access-date=2022-07-12
While some aspects of [[Haskell]] inform the design of Rust,<ref name="influences"/> these languages have many, varied relative strengths and limits effecting programming and performance.<ref>{{cite news |last1=Prabakaran |first1=Sibi |date=June 30, 2025 |url=https://academy.fpblock.com/blog/rust-haskell-reflections/ |title=Reflections on Haskell and Rust |website=FP Block |access-date=2025-07-19}}</ref>
== Adoption ==
|