3 ms·
I tried the same code with clang instead of tcc. Compilation time is 700-800ms. Run time is about half as tcc, compiled with -O3 (45-55ms)
by stephc_int13 3y ago
I tried the same code with clang instead of tcc.
Compilation time is 700-800ms.
Run time is about half as tcc, compiled with -O3 (45-55ms)
- KerrAvon 3y agosounds right - tcc is a fast compiler, not an optimizing one. clang is faster than many, but optimizations take time to run.
- stephc_int13 3y agoYes, absolutely, this is a tradeoff. Running C code at 50% max speed is OK for me when running debug builds. Clang being slower to compile is not an issue because I can use tcc. Unfortunately I can't use all those nice C++ features with tcc.
- stephc_int13 3y agoAlso, it depends on the type of code. I tried to replace the quicksort with a radix sort, and the difference is much closer on this better optimized code (15ms vs 17ms).