A Study of Execution Performance for Rust-Based Object Vs Data Oriented Architectures

A Study of Execution Performance for Rust-Based Object Vs Data Oriented Architectures

Air Force Institute of Technology AFIT Scholar Theses and Dissertations Student Graduate Works 3-26-2020 A Study of Execution Performance for Rust-Based Object vs Data Oriented Architectures Joseph A. Vagedes Follow this and additional works at: https://scholar.afit.edu/etd Part of the Computer and Systems Architecture Commons Recommended Citation Vagedes, Joseph A., "A Study of Execution Performance for Rust-Based Object vs Data Oriented Architectures" (2020). Theses and Dissertations. 3191. https://scholar.afit.edu/etd/3191 This Thesis is brought to you for free and open access by the Student Graduate Works at AFIT Scholar. It has been accepted for inclusion in Theses and Dissertations by an authorized administrator of AFIT Scholar. For more information, please contact [email protected]. A STUDY OF EXECUTION PERFORMANCE FOR RUST-BASED OBJECT VS DATA ORIENTED ARCHITECTURES THESIS Joseph Vagedes, 2nd Lt, USAF AFIT-ENG-MS-20-M-065 DEPARTMENT OF THE AIR FORCE AIR UNIVERSITY AIR FORCE INSTITUTE OF TECHNOLOGY Wright-Patterson Air Force Base, Ohio DISTRIBUTION STATEMENT A APPROVED FOR PUBLIC RELEASE; DISTRIBUTION UNLIMITED. The views expressed in this document are those of the author and do not reflect the official policy or position of the United States Air Force, the United States Department of Defense or the United States Government. This material is declared a work of the U.S. Government and is not subject to copyright protection in the United States. AFIT-ENG-MS-20-M-065 A STUDY OF EXECUTION PERFORMANCE FOR RUST-BASED OBJECT VS DATA ORIENTED ARCHITECTURES THESIS Presented to the Faculty Department of Electrical and Computer Engineering Graduate School of Engineering and Management Air Force Institute of Technology Air University Air Education and Training Command in Partial Fulfillment of the Requirements for the Degree of Master of Science in Computer Engineering Joseph Vagedes, B.S.C.E. 2nd Lt, USAF March 19, 2020 DISTRIBUTION STATEMENT A APPROVED FOR PUBLIC RELEASE; DISTRIBUTION UNLIMITED. AFIT-ENG-MS-20-M-065 A STUDY OF EXECUTION PERFORMANCE FOR RUST-BASED OBJECT VS DATA ORIENTED ARCHITECTURES THESIS Joseph Vagedes, B.S.C.E. 2nd Lt, USAF Committee Membership: Douglas D Hodson, Ph.D Chair Scott L Nykl, Ph.D Member Ryan D Engle, Ph.D Member AFIT-ENG-MS-20-M-065 Abstract In recent years, advances in the performance of computer hardware technology has begun to slow due the physical limitations of modern transistors including feature size and heat dissipation issues [1, 2]. Engineers have turned to adding additional cores to Central Processing Units (CPUs) to improve performance, however many modern day applications are not designed to take advantage of multi-core parallelism effectively. Software developers are no longer able to rely on improved hardware for increased performance in their software; they must turn to software optimizations. The memory layout of a software system is one area that directly contributes to the performance of the software as it affects access time and throughput of data in cache [1]. This area of optimization tends to be overlooked by developers as they do not have the necessary technical background in computer architecture. In general, the commonly used programming paradigm, Object-Oriented Programming (OOP), does not store data in memory in such a way that it can be optimally used by the cache, resulting in slower performance. This research investigates the Data-Oriented Design (DOD) paradigm, in partic- ular, an architecture built off its principles: Entity-Component-System (ECS). ECS is commonly used by video game engines due to its ability to store data in a way that is optimal for the cache to access. Additionally, the structure of this paradigm produces a code-base that is simple to parallelize as the workload can be distributed across a thread-pool based on the data used with little to no need for data safety measures such as mutexes and locks. A final benefit, although not easily measured, is that the DOD paradigm produces a highly decoupled ( i.e., a strong separation of concerns) code-base, resulting in more easily maintainable and extensible code. iv DOD and ECS are not a catch-all replacement for OOP; they are most optimal for software systems with large amounts of data being used and operated on consistently [3]. This is why it is actively being developed and used in video game engines. This research argues that due to the similarities between video game engines and real-time simulators, this paradigm can replace the commonly used OOP paradigm in real-time simulators to improve performance. To demonstrate the performance differences between the two paradigms for use in real-time simulators, two separate code-bases were developed, each using one of the paradigms. Multiple experiments were run on each code-base to determine how tolerant each was to changes in important aspects of simulations such as the amount of data used in a simulation. The DOD paradigm consistently outperformed the OOP paradigm in all experiments; it was seen that as more data is used in an experiment, the larger the difference in performance between the DOD and OOP paradigms. This research closes by emphasizing that DOD is not a replacement to OOP in all use cases. DOD is most optimal in code-bases that contain and operate on a large amounts of data; this includes, but is not limited to, areas such as video games engines, real-time and non-real-time simulations, and high performance computing. This paradigm also has a strong use case for the development of multi-threaded applications as it reduces the complexity of developing the software system as methods for operating on data can be automatically distributed across a threadpool by a scheduler. This reduces, if not eliminates, the need for developers to think about data safety and mechanisms such as mutexes and locks. v Table of Contents Page Abstract . iv List of Figures . ix List of Tables . .x I. Introduction . .1 1.1 Background . .1 1.2 Problem Statement . .2 1.3 Research Goals . .3 1.4 Hypothesis . .3 1.5 Approach . .3 1.6 Assumptions/Limitations . .4 1.7 Contributions . .5 1.8 Thesis Overview. .5 II. Background . .6 2.1 Overview . .6 2.2 Computer Hardware . .6 2.3 Object-Oriented Programming . 10 2.3.1 C++ . 14 2.4 Data-Oriented Design . 21 2.4.1 Rust . 24 2.5 Entity-Component-System . 30 2.5.1 Entity . 31 2.5.2 Component . 31 2.5.3 System . 32 2.5.4 Execution Pattern . 33 2.6 Specs......................................................... 35 III. Methodology . 39 3.1 System Under Study . 39 3.2 Variables . 39 3.3 Assumptions . 40 3.4 Statistical Analysis . 41 3.5 Experimental Design . 43 3.5.1 OOP Benchmark Design. 45 3.5.2 DOD Benchmark Design . 45 3.5.3 Experiment One . 47 3.5.4 Experiment Two . 48 vi Page 3.5.5 Experiment Three . 50 3.5.6 Experiment Four . 51 3.5.7 Experiment Five . 52 3.5.8 Experiment Six . 53 3.6 Data Logging . 54 3.7 Summary . 55 IV. Results and Analysis . 56 4.1 Overview . 56 4.2 Experiment 1 . 56 4.3 Experiment 2 . 59 4.4 Experiment 3 . 62 4.5 Experiment 4 . 69 4.6 Experiment 5 . 71 4.7 Experiment 6 . 73 V. Conclusion . 76 5.1 Overview . 76 5.2 Research Conclusions . 76 5.3 Research Significance and Future Work . 78 Appendix A. Benchmark Measurement and Analysis . ..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    353 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us