tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] performance


From: Christian Jullien
Subject: Re: [Tinycc-devel] performance
Date: Tue, 23 Jan 2018 07:41:09 +0100

Daniel,

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.

 

C.

 

From: Tinycc-devel [mailto:address@hidden On Behalf Of Daniel Zvinca
Sent: lundi 22 janvier 2018 15:30
To: address@hidden
Subject: [Tinycc-devel] performance

 

Hi there,

 

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)

{

            for(int i=0;i<count;i++) 

              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++)

 {

  a_[i]=NTESTING+i+1;

  c_[i]=NTESTING+2*(i+1);

 }

 

Thanks,

Dan

 

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]