Coder Social home page Coder Social logo

ee194_final_proj's Introduction

ee194_final_proj

Final project for EE194: Advanced Topics in Computer Architecture

Riley Wood Josh Pfosi Henry Zhou

We would like to compare the performance of Rust's concurrency constructs with those of C. We will do this by comparing a set of benchmarks implemented in C and Rust. As a control, we will implement a single-threaded version of each benchmark so that we can have a baseline comparison of the two languages. Then from there we will compare the performance of the two languages on a multi-threaded implementation of the same benchmarks. Any new differences that arise can be attributed with confidence to the way each language implements concurrency.

If rustc encounters an error with lgmp: sudo apt-get install libgmp3-dev

ee194_final_proj's People

Contributors

rjw245 avatar joshpfosi avatar ehnree avatar

Stargazers

Claudia Doppioslash avatar

Watchers

 avatar  avatar  avatar

ee194_final_proj's Issues

Some mistakes in our description of Rust

See here: https://www.reddit.com/r/rust/comments/4qnj8b/comparing_concurrency_in_rust_and_c/d4uhwy4

And copy pasted:
Cool!
Some nits:

In other words, the threads’ access to the Sync data is mutually exclusive.

The standard library relies on Mutex and friends, but there are lock-free types (see crossbeam) which allow concurrent access without mutual exclusion.

Often, multithreading in C involves passing pointers to the same data to different threads, creating a potential data race depending on the threads’ access pattern. Rust’s type system prevents threads from directly sharing references to the same memory. Instead, Rust mandates that such sharing be managed by the Arc type,

Arc, IIUC, prevents dangling pointers, not data races.

Compile parameters

We don't specify the parameters we compile with. We also ought to compile both the Rust and C code with optimizations before running. The community expects this will improve Rust's performance compared to C drastically. Someone on reddit also said:

The paper doesn't mention how the C code is compiled.rustc doesn't compile directly to assembly; it compiles to LLVM IR, and uses LLVM to compile to assembly. If the C code in this paper is compiled with gcc, any performance gap could be caused by a difference between the GCC and LLVM optimizers. To isolate any differences between C and Rust, it would be better to use clang to compile the C code, since it also uses the LLVM optimizer and backend.

So we ought to switch to clang as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.