Return to search

Attainable Safety and Long-Term Resource-Efficiency Using Rust : Evaluating the Viability of Rust in Terms of Development Effort and Performance for the Decompilation of ASN.1 Messages

This report investigates how a telecommunication company might reduce its resource usage in terms of execution time by using Rust for the decompilation of ASN.1 messages. To contrast these results and to offer insights into other factors for choosing a language, the developer experience of Rust was also studied. Interviews were conducted to get developers' input on aspects such as the learnability and ergonomics of Rust, and these were analyzed through a thematic analysis. This revealed that developers appreciated working with Rust, mainly due to its ease of use, its enforcement of good development standards, the helpfulness of the compiler, and the well-structured and understandable documentation. Two ASN.1 decompiler implementations were made, one in C++ and one in Rust. Both decompilers invoked third-party C++ functions: in Rust, this was done by first wrapping them in C. The performance of both decompilers was measured during two benchmarking sessions, between which additional optimization was performed on both. The results were then compared statistically using the Mann-Whitney rank sum test method. The first benchmarking session showed similar performance for both decompilers, despite the Rust implementation performing additional tasks by first wrapping the C++ functions in C. However, both decompilers contained unintentional copies of values in the C++ code, with the C++ decompiler containing the majority. In the second benchmarking session, the Mann-Whitney test showed that the Rust decompiler performed worse, with a mean difference of 85.19-91.36%. In practice, however, it is seldom efficient for most applications to try to optimize code to the point of being perfect. Therefore, the decompilers of the first benchmarking session are considered more representative of software in general as they had gone through a code check more like what is often performed in practice. The interview and benchmarking results together show that in practice, Rust would likely be more resource-efficient, safer and more maintainable. This is because it prevents many bugs and likely leads to more well-structured applications of higher long-term quality, that perform at a level similar to C++ implementations for applications not put under exceptional scrutiny. Still, organizations integrating Rust into their code base would need to further evaluate factors such as Rust's toolchain support and scalability as well as the potential risks of it being a newer language.

Identiferoai:union.ndltd.org:UPSALLA1/oai:DiVA.org:liu-195552
Date January 2023
CreatorsEmberg, Cecilia, Wadsten, Anna
PublisherLinköpings universitet, Institutionen för datavetenskap
Source SetsDiVA Archive at Upsalla University
LanguageEnglish
Detected LanguageEnglish
TypeStudent thesis, info:eu-repo/semantics/bachelorThesis, text
Formatapplication/pdf
Rightsinfo:eu-repo/semantics/openAccess

Page generated in 0.0024 seconds