Hello, In first place I'm not going to do an algorithmic benchmark, just a simple loop + print test and some checks on the generated binaries.
The system is a Debian12 Linux and the architecture is: x86 64bits.
Mojo don't allow .py extension it has to be .mojo so no default nvim highlighting ...
$ mojo build mojo_benchmark.mojo
$ time ./mojo_benchmark
...
real 0m0.342s
user 0m0.080s
sys 0m0.252s
$ rustc rust_benchmark.rs
$ time ./rust_benchmark
...
real 0m0.107s
user 0m0.012s
sys 0m0.049s
I noticed a speed increase using fish shell instead of bash but could be the environment variable stack overload.
So in this specific test rust is much faster. And also the compiler suggests using _ instead i, that mojo compiler doesn't.
The rust binary is bigger, but is because the allocator is embedded:
-rwxr-xr-x 1 sha0 sha0 1063352 Jan 10 08:55 mojo_benchmark
-rwxr-xr-x 1 sha0 sha0 4632872 Jan 10 08:57 rust_benchmark
But Look this, mojo uses libstdc++ and libc and rust only uses libc.
$ ldd -d mojo_benchmark
linux-vdso.so.1 (0x00007ffd94917000)
libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007fe899cb1000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fe899a00000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe899921000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fe899c91000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe899740000)
/lib64/ld-linux-x86-64.so.2 (0x00007fe899d2c000)
$ ldd -d rust_benchmark
linux-vdso.so.1 (0x00007ffde67b7000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8b3881b000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8b3863a000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8b388ae000)
Related links
- Hacker Tools Linux
- Pentest Tools Free
- Pentest Tools Free
- Pentest Tools Github
- Hacker Tools Mac
- Hacking Tools For Mac
- Hacking Tools Pc
- Hack Tools Online
- New Hack Tools
- Hacking Tools For Beginners
- New Hacker Tools
- Hacker Tools Free
- Hacking Tools Github
- Hack Tools 2019
- Black Hat Hacker Tools
- Hacker Tools List
- Computer Hacker
- Hack Tools 2019
- Game Hacking
- Hacking Tools And Software
- Hacking Tools
- Bluetooth Hacking Tools Kali
- Easy Hack Tools
- Hacker
- Pentest Tools For Mac
- Pentest Box Tools Download
- Hacker
- Hacker Tools Mac
- Hacking Tools Online
- Pentest Tools Url Fuzzer
- Pentest Tools Windows
- Nsa Hack Tools Download
- Hacker Tools List
- Pentest Tools Website Vulnerability
- Hacking Tools Kit
- Hack And Tools
- Hack Tools For Ubuntu
- Best Pentesting Tools 2018
- What Are Hacking Tools
- Pentest Tools Online
- Hacking Tools Hardware
- Pentest Tools Tcp Port Scanner
- Black Hat Hacker Tools
- Hacker Tools Mac
- Hacker Tools Hardware
- Hacker Tools Free Download
- Hacker Security Tools
- Hack Tools For Ubuntu
- Pentest Tools Kali Linux
- Hacking Tools Windows 10
- Hacker Hardware Tools
- World No 1 Hacker Software
- Hack Rom Tools
- Hacker Hardware Tools
- Pentest Tools Website
- Pentest Tools
- Hacker Tools For Pc
- How To Install Pentest Tools In Ubuntu
- Hacking Tools Usb
- Pentest Tools Website Vulnerability
- Hack Tool Apk No Root
- Hacking Tools Pc
- Hacking Tools Download
- Easy Hack Tools
- Pentest Tools Apk
- Pentest Tools Windows
- Hacker
- Pentest Tools Free
- Hack Tools For Ubuntu
- Hack App
- Hack Tools Online
- Hacker Tools Windows
- Pentest Tools Download
- Hacking Tools Windows 10
- Pentest Tools For Android
- Hacker Tools Hardware
- Hacking Tools For Beginners
- Hackers Toolbox
- Pentest Tools Bluekeep
- Pentest Tools Android
- Ethical Hacker Tools
- Hacking Tools
- Hacker Tools For Mac
- What Are Hacking Tools
- Hack Tools For Windows
- Pentest Tools Online
- Hacking Tools 2020
- Pentest Tools Port Scanner
- Android Hack Tools Github
- Hacker Tool Kit
- Hack Tools 2019
- Hacker Tools 2019
- Hacker Tools 2020
- Hacking Tools For Mac
- Underground Hacker Sites
- Hack Tools Github
- Hacking Tools Online
- What Are Hacking Tools
- Hacking Tools Online
- Hacking Tools Mac
- Hack And Tools
- Hacking Tools And Software
- Pentest Automation Tools
- Hacker Tools 2019
- Hak5 Tools
- How To Install Pentest Tools In Ubuntu
- Hacker Hardware Tools
- How To Hack
- Hacker Tools For Windows
- Hacking Tools Mac
- Hack Tools
- Hacking Apps
- World No 1 Hacker Software
- Pentest Reporting Tools
- Hacking Tools 2020
- Pentest Tools List
- Pentest Tools Review
- Hacker Search Tools
- How To Hack
- Pentest Tools Website
- Hacking Tools For Windows 7
- Hack Tools Mac
- World No 1 Hacker Software
- Hacking App
- Hack Rom Tools
- Pentest Box Tools Download