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)
More articles
- Hacking Tools Windows 10
- Pentest Tools Nmap
- Pentest Tools Download
- Physical Pentest Tools
- Hack App
- Hack Tools For Mac
- Blackhat Hacker Tools
- Pentest Tools Url Fuzzer
- Pentest Tools Free
- Hack Website Online Tool
- Hacker Search Tools
- Hacker Tools Hardware
- World No 1 Hacker Software
- Hack Tools
- Hacking Tools
- Best Hacking Tools 2020
- Hacker Tools For Windows
- Hacker Tools Linux
- Hacker Tools 2020
- Hacker Tools Apk
- Android Hack Tools Github
- Hacking Tools Kit
- Pentest Tools For Mac
- Hack Tool Apk No Root
- Hack Rom Tools
- Pentest Tools Website Vulnerability
- Hack Tools For Windows
- Pentest Tools Android
- Hacking Tools For Beginners
- Underground Hacker Sites
- Hacker Tools Mac
- Pentest Tools List
- Tools Used For Hacking
- Hacker Tools Free Download
- Pentest Tools Framework
- Termux Hacking Tools 2019
- Hack App
- Pentest Recon Tools
- New Hacker Tools
- Pentest Tools Bluekeep
- Wifi Hacker Tools For Windows
- Hack Tools Download
- Hacking Tools Hardware
- Hacker Tools 2020
- What Are Hacking Tools
- Hack Tools For Mac
- Pentest Tools Framework
- What Is Hacking Tools
- Hack Tools Online
- Hacking Tools Kit
- Pentest Tools Download
- What Are Hacking Tools
- Pentest Tools Github
- Hacking Tools Pc
- Pentest Tools Subdomain
- Hacker
- Hacker Tools Free
- Computer Hacker
- New Hacker Tools
- Hacking Tools For Kali Linux
- Hacker Tools Apk Download
- Hacker Tools Software
- Hacker Tool Kit
- Hack Tools For Ubuntu
- Pentest Recon Tools
- Pentest Tools For Windows
- Hackrf Tools
- What Is Hacking Tools
- Hacking Tools Windows
- Hack Tool Apk
- Wifi Hacker Tools For Windows
- Kik Hack Tools
- Hacker Tools Github
- Hacker Tools For Mac
- Hack Website Online Tool
- Hacking Tools For Pc
- Computer Hacker
- Hacking Tools Hardware
- Pentest Tools Tcp Port Scanner
- Hack Tools For Ubuntu
- Hacking Tools For Beginners
- Hacking Tools For Mac
- Pentest Automation Tools
- Pentest Tools For Mac
- What Is Hacking Tools
- How To Make Hacking Tools
- Growth Hacker Tools
- Pentest Tools Online
- Hacker Tools 2019
- How To Hack
- Hacks And Tools
- Pentest Tools Download
- Game Hacking
- Hacker Tools 2020
- What Are Hacking Tools
- Pentest Tools Framework
- Hacker Tools For Windows
- Pentest Tools Free
- Hack Tools For Pc
- Hack Apps
- Beginner Hacker Tools
- Pentest Reporting Tools
- Hacker Tools Apk Download
- Pentest Tools Android
- Pentest Tools For Android
- Hacking Tools For Games
- Hack Tools For Pc
- Underground Hacker Sites
- Pentest Tools Android
- Ethical Hacker Tools
- How To Hack
- Hacking Tools Pc
- Hack App
- Hacking Tools For Kali Linux
- How To Install Pentest Tools In Ubuntu
Nincsenek megjegyzések:
Megjegyzés küldése