Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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)



sounds right - tcc is a fast compiler, not an optimizing one. clang is faster than many, but optimizations take time to run.


Yes, 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.


Also, 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).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: