Evaluating Rust Ethan Larkham & Todd Gaunt Department of Computer Science, University of New Hampshire, Durham, NH 03824 Abstract Objectives Results Compare.

Slides:



Advertisements
Similar presentations
Department of Computer Science and Engineering University of Washington Brian N. Bershad, Stefan Savage, Przemyslaw Pardyak, Emin Gun Sirer, Marc E. Fiuczynski,
Advertisements

Chapter 10: Compilers and Language Translation Invitation to Computer Science, Java Version, Third Edition.
MATSEC Past Papers May 2010 Paper 1 Paper 2A. What is the difference between each of the following pairs of items? Syntax Error Caused by forgetting certain.
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
COMP 111 Threads and concurrency Sept 28, Tufts University Computer Science2 Who is this guy? I am not Prof. Couch Obvious? Sam Guyer New assistant.
Intermediate 2 Computing Unit 2 - Software Development Topic 2 - Software Development Languages and Environments.
Software. Introduction n A computer can’t do anything without a program of instructions. n A program is a set of instructions a computer carries out.
Chapter 1 Introduction Samuel College of Computer Science & Technology Harbin Engineering University.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
Object Lifetime and Pointers
Chapter 7: Modifiability
Programming what is C++
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha Fall 2015
Topic: Programming Languages and their Evolution + Intro to Scratch
Chapter 1 Introduction to Computers, Programs, and Java
SOFTWARE DESIGN AND ARCHITECTURE
Lecture 3 of Computer Science II
Optimization Code Optimization ©SoftMoore Consulting.
Setting up your DEV C++.
State your reasons or how to keep proofs while optimizing code
Computer Programming.
Name of the Poster Goes Here
Objective of This Course
Chapter 3: The Efficiency of Algorithms
Unit# 6: ICT Applications
Fundamentals of Programming
Name of the Poster Goes Here
Name of the Poster Goes Here
Name of Poster Goes Here Poster Subtitle Goes Here Author 1 & Author 2 Department of [Insert Name], University of New Hampshire Introduction Results.
Place your Project Logo Here
Name of Poster Goes Here
This Scientific Poster Template Is Provided By MakeSigns
Name of Poster Goes Here Poster Subtitle Goes Here Author 1 & Author 2 Department of [Insert Name], University of New Hampshire Introduction Results.
Name of the Poster Goes Here
Name of the Poster Goes Here
This Scientific Poster Template Is Provided By MakeSigns
Place your Project Logo Here
This Scientific Poster Template Is Provided By MakeSigns
Name of Poster Goes Here Poster Subtitle Goes Here Author 1 & Author 2 Department of [Insert Name], University of New Hampshire Introduction Results.
This Scientific Poster Template Is Provided By MakeSigns
Place your Project Logo Here
Name of Poster Goes Here Poster Subtitle Goes Here Author 1 & Author 2 Department of [Insert Name], University of New Hampshire Introduction Results.
Name of Poster Goes Here Poster Subtitle Goes Here Author 1 & Author 2 Department of [Insert Name], University of New Hampshire Introduction Results.
CSC 427: Data Structures and Algorithm Analysis
Name of Poster Goes Here
Place your Project Logo Here
Name of the Poster Goes Here
Analysis of Algorithms Growth Rates
This Scientific Poster Template Is Provided By MakeSigns
Computational Thinking
Name of Poster Goes Here
Chapter 10: Compilers and Language Translation
Name of Poster Goes Here Poster Subtitle Goes Here Author 1 & Author 2 Department of [Insert Name], University of New Hampshire Introduction Results.
Place your Project Logo Here
Reasons To Study Programming Languages
This Scientific Poster Template Is Provided By MakeSigns
This Scientific Poster Template Is Provided By MakeSigns
Place your Project Logo Here
Name of Poster Goes Here
Name of Poster Goes Here
Name of Poster Goes Here
Name of Poster Goes Here
Name of Poster Goes Here
Name of Poster Goes Here
From Use Cases to Implementation
Exceptions and networking
Name of Poster Goes Here
This Scientific Poster Template Is Provided By MakeSigns
Examining the Effects that Institutional Quality has on Economic Recovery After a Natural Disaster (2005 and 2008) Brendan Mooney, Peter T. Paul School.
Presentation transcript:

Evaluating Rust Ethan Larkham & Todd Gaunt Department of Computer Science, University of New Hampshire, Durham, NH 03824 Abstract Objectives Results Compare the performance of rustc and clang++ to see if rustc can generate programs as performant as clang++ Highlight the different capabilities of the languages objectively. Analyze the data structures used by each compiler and compare the optimizations made when the performance difference between programs written in each language is not obvious. Describe the experience of writing in each language. Does Rust make it easier to write safe code? Is C++ difficult to troubleshoot or develop with in comparison? The purpose of this project was to compare Rust with C++. Rust was tested to see if it held up to its claims of being nearly as performant as C++, and if the language made writing safe programs easy. These tests and analysis were carried out using three small programs written at least twice in each Rust and C++. Each implementation attempted to use as similar an algorithm as possible to solve the problem at hand, and were used to benchmark performance. Rust tended to perform worse due to various limitations in the language Found inability to create a mutable global 2D array in Rust necessitating the use of vectors, causing Jacobi’s poor performance Pi digits performed comparably well in each language. Wordfind had a near constant overhead, Rust performance was improved when words were shared in batches For Jacobi, Rust parallel eventually was able to beat the Rust serial Jacobi, while C++ parallel performed worse than C++ serial Vectors could not compete with arrays Methodology Graphs Conclusions Write three programs, “Pi-digits”, “Jacobi”, and “Wordfind” in each language with similar algorithms Alternate which language each member writes in to allow each to gain experience with Rust Objectively analyze program performance during runtime on a machine with no extraneous processes running Subjectively remark and report on the ease-of-use of each language Graph the performance of each program over an average of runs to reduce performance intermittent performance anomalies. Pi Comparison (8 runs) It appears from our results that Rust's "fearless concurrency" is at the cost of performance. At first glance Rust appeared to be an attractive more secure C++ alternative with better built in concurrency handling. Rust's "fearless concurrency" was attributed to its compiler's ability to detect threading errors without forcing the developer to test during runtime. Rust's compiler features, while guaranteeing safety in a program, reject many correct programs which requires the developer to write around the language for certain algorithms. In order for the compiler to guarantee its safety, strict rules must be followed by the developer throughout the program. Programming in Rust can be a fight against the compiler when writing even trivial concurrent programs. This is also all at the cost of performance since, even without runtime checks, the safety guarantees often have overhead. In most programs benchmarked Rust performed noticeably worse. For a fast system language, Rust may not be a suitable replacement for C++. Wordfind Comparison (16 runs) T Benchmarks Serial 2D Vector and Array Comparison (8 runs) Jacobi Comparison (8 runs) “Pi-digits” is a concurrent implementation of using Riemann sums to compute the value of pi. “Jacobi” runs the Jacobi temperature distribution algorithm concurrently by subdividing the array where the computation is being performed horizontally between threads. Implemented four times, in two different ways. “Wordfind” utilizes a concurrent hashtable to find the largest word over 6 ASCII characters long in a given set of text files, usually books. The serial 2D vector benchmarks were written to discover a potential reason for Jacobi’s poor performance in Rust. Acknowledgements Professor Philip J. Hatcher Professor Collette Matthias Powers

This poster template provided courtesy of UNH ESRC Poster Printing Services Trust us to make your poster look GREAT! Website: http://posters.unh.edu Poster Guide: http://goo.gl/1E7TJY DELETE THIS SLIDE BEFORE PRINTING