r/Compilers • u/Upper-Ad4677 • Oct 20 '26
COMPRINLY vs NASM vs C
http://github.com/rhyelt/ComprinlyI benchmarked all three languages with their standard commands and the standard scripts without any made optimizations in the scripts.
The benchmark is Compile, Run, and Size.
Hello, World!:
Language - Compile - Run - Size
C (GCC 13.3) - 35.5 ms - 2.3 ms - 15,960 bytes
NASM 2.16 with LD - 6.4 ms - 1.5 ms - 8,864 bytes
COMPRINLY 1.3.2 - 9.6 ms - 1.5 ms - 274 bytes (Old version was 290 bytes)
Count primes below 300,000:
Language - Compile - Run - Size
C (GCC 13.3) - 38.6 ms - 50.2 ms - 15,960 bytes
NASM 2.16 with LD - 6.6 ms - 48.4 ms - 5,032 bytes
COMPRINLY 1.3.2 - 10.7 ms - 48.4 ms - 361 bytes
You could test Comprinly for this if you doubt the benchmark, I have no testers.
Overall:
Compile Speed - NASM
Run Speed - NASM and Comprinly
Size - Comprinly
You can try Comprinly in the linked repo
1
u/[deleted] Oct 21 '26
Are you seriously comparing build time of Hello-World, and its runtime?
This is like 15 loc in assembly, and perhap 4 lines in C.