|Subject:||Re: [Tinycc-devel] performance|
|Date:||Tue, 23 Jan 2018 07:41:09 +0100|
Tcc is wonderful C compiler that compiles your code blazing fast. As there is no free lunch, it achieves this **compilation** speed in only one pass. It is definitively NOT competing with top notch professional quality multi-pass optimizing compilers.
Tcc could probably marginally be optimized for execution speed but don’t expect something close to gcc or vc++ with all optimization turned on.
Tcc is used for fast development cyles and as **reasonably** fast JIT compiler. It is not that bad. If you want to save the last cycles of your CPU, tcc is probably not for you.
From: Tinycc-devel [mailto:address@hidden On Behalf Of Daniel Zvinca
I'm in the process of translating certain AST code into C code, compile on fly and execute the compiled code. Everything works just fine, except the performance. In terms of performance, a very simple code seems to be at least 2 times slower than compiled Pelles C code (similar benchmark has also MSVC). Are they any optimizations or so I can bring to below code (or compilation/linker parameters) to have a similar speed (+/- 15% is ok)
Here is the test code:
void test(double * res, double * a, double b, double * c, double d, int count)
res[i] = a[i]*b + c[i]*d;
The results of the test were similar for tcc_compile_string and for generated by tcc dll (~165ms, average for 5 times loop, against ~84ms any other solution)
Count had a value of 50,000,000. And values used for testing were generated using the following code (outside the library)
double b_ = 2.5;
double d_ = 5.0;
#define NTESTING 50000000
for (int i=0;i<NTESTING;i++)
|[Prev in Thread]||Current Thread||[Next in Thread]|