Giter VIP home page Giter VIP logo

matrix-mult-benchmarks's Introduction

Matrix Multiplication Benchmarks

This repository contains a fun benchmark comparison of matrix multiplication implementations across multiple programming languages.

Disclaimer

This project is intended for fun and educational purposes only. The results should not be taken as definitive performance metrics for any of the included languages. Performance can vary based on numerous factors including compiler optimizations, hardware, and specific use cases.

Languages Included

  • C
  • C++
  • Go
  • Java
  • Python
  • Rust
  • Python with C extension

Structure

Each language's implementation is contained in its own directory with the necessary source code and Dockerfile to build and run the program.

  .
  ├── matrix-c-plus
  │   ├── Dockerfile
  │   └── matrix_multiplication.cpp
  ├── matrix-go
  │   ├── Dockerfile
  │   ├── go.mod
  │   └── matrix_multiplication.go
  ├── matrix-java
  │   ├── Dockerfile
  │   └── MatrixMultiplication.java
  ├── matrix-python
  │   ├── Dockerfile
  │   └── matrix_multiplication.py
  ├── matrix-rust
  │   ├── Dockerfile
  │   └── matrix_multiplication.rs
  ├── matrix-python-c
  │   ├── Dockerfile.python-c
  │   ├── matrix_multiplication.c
  │   ├── setup.py
  │   └── matrix_multiplication.py
  ├── matrix-c
  │   ├── Dockerfile
  │   └── matrix_multiplication.c
  ├── Makefile
  └── README.md

How to Build and Run

  1. Clone the repository:

    git clone https://github.com/Jasintha/matrix-mult-benchmarks.git
    cd matrix-mult-benchmarks
  2. Build all Docker images:

    make build
  3. Run the benchmarks for all languages:

    make run-all MATRIX_SIZE=1000

Results

Here are the benchmark results for matrix size 1000:

Language Time (seconds)
Go 0.109532197
C++ 0.563254000
Rust 0.802906297
C 1.459348000
Python-C 1.574121475
Java 1.760523987
Python 2.505929470

License

This project is licensed under the MIT License - see the LICENSE file for details.

matrix-mult-benchmarks's People

Contributors

jasintha avatar

Watchers

 avatar

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.