Skip to content

A simple problem to compare execution speed between Numba and C++

Notifications You must be signed in to change notification settings

Hameon4/Numba_vs_Cpp_vs_Rust_speed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Numba vs C++ vs Rust

A simple problem to compare execution speeds between Python w/ Numba, C++ w/ optimization, and Rust using its package manager 'cargo' via 'cargo run --release' command

  • Text Editor: VsCode

  • Size of list/vector: 20000

Test Benchmarks on ten attempts on each languages:

  • [Python w/ Numba]: (in milliseconds)
    • Array List: Array List: [735.00061035 617.51627922 613.51847649 610.07523537 602.12874413 612.00761795 603.58858109 609.18903351 609.75456238 606.22835159]
    • Average: ~622 milliseconds
    • Fastest speed recorded: ~ 600 milliseconds

  • [C++ w/ optimization]: (in milliseconds)
    • Compiler: g++ version 11.1
    • Compilation command: g++-11 -Ofast -std=c++2a findMax.cpp
    • 62.500, 46.875, 46.875, 46.875, 46.875, 46.875, 31.250, 46.875, 62.500, 46.875
    • Average: ~ 48.4375 milliseconds
    • Fastest speed recorded: ~ 31.25 milliseconds

  • [Rust]: (in microseconds)
    • Compilation command: cargo run --release
    • 269, 522.7, 651.4, 322, 428.3, 385.3, 412.9, 751, 622, 664.6
    • Average: 502.92 microseconds
    • Fastest speed recorded: ~ 228 microseconds

About

A simple problem to compare execution speed between Numba and C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published