Planned maintenance
A system upgrade is planned for 24/9-2024, at 12:00-14:00. During this time DiVA will be unavailable.
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Performance evaluation of Multithreading, Hashtables, and Anonymous Functions for Rust and C++: in Game Development
Blekinge Institute of Technology, Faculty of Computing, Department of Computer Science.
Blekinge Institute of Technology, Faculty of Computing, Department of Computer Science.
2023 (English)Independent thesis Basic level (degree of Bachelor), 10 credits / 15 HE creditsStudent thesis
Abstract [en]

Background

C++ is a programming language introduced in 1985, while Rust was introduced in 2010. Rust focuses on speed and safety and was created with the need for concurrency in mind.These languages have different memory management systems as C++ originally only supported manual memory management, while Rust's memory management system performs checks before the compilation of the application begins to prevent issues such as dereferencing null pointers, use-after-free errors, and buffer overflows.These languages' standard libraries have some features in common such as anonymous functions,  hashtables, and threads.These features can be utilized in games by implementing resource management with hashtables, event systems with anonymous functions, and parallelization with threads.

Objectives

The objectives included designing two equivalent game implementations, one with Rust and one with C++. These games were the testing grounds used to test the standard library implementations of anonymous functions, hashtables, and threads. These features' execution times were measured and compared to determine if there existed a difference between them in Rust and C++.

Methods

Using Raylib, two identical games have been created that utilized and collected execution time metrics for anonymous functions, hashtables, and threads. These games were executed 90 times for a duration of 10 seconds. When all tests were completed, the execution time data was compiled. This data was visualized and analyzed to determine the differences in execution time between Rust and C++ for these specific features.

Results

The results indicate that Rust performs better at creating anonymous functions, searching and deleting entries in hashtables, and joining threads. The results also reveal that C++ performs better at calling anonymous functions, inserting into hashtables, and creating and starting threads.

Conclusions

A substantial statistical difference exists between the execution times for the selected features in Rust and C++. The performance differences are significant to the extent that a developer can gain some performance by selecting the language that performs best depending on their needs. In the end, both languages are well suited for game development based on the result of this limited study.

Place, publisher, year, edition, pages
2023. , p. 45
Keywords [en]
C++, Comparison, Execution time, Rust, Wilcoxon
National Category
Computer Sciences
Identifiers
URN: urn:nbn:se:bth-25559OAI: oai:DiVA.org:bth-25559DiVA, id: diva2:1810063
Subject / course
DV1478 Bachelor Thesis in Computer Science
Educational program
DVGSP Game Programming
Supervisors
Examiners
Available from: 2023-11-08 Created: 2023-11-06 Last updated: 2023-11-08Bibliographically approved

Open Access in DiVA

Performance evaluation of Multithreading, Hashtables, and Anonymous Functions for Rust and C++ in Game Development(611 kB)115 downloads
File information
File name FULLTEXT02.pdfFile size 611 kBChecksum SHA-512
e7a27df5d43322224d9fde21510295e3eeb7e4d9fcad2580d42c1179580216c5df68a070640cf7e0d26e1b2a57d2c9cf8e230db1d2bab2749bd66807d22a082d
Type fulltextMimetype application/pdf

Search in DiVA

By author/editor
Nordström, OscarRaivio, Lowe
By organisation
Department of Computer Science
Computer Sciences

Search outside of DiVA

GoogleGoogle Scholar
Total: 115 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 424 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf