lua-users home
lua-l archive

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


Dave Dodge wrote:
On Wed, Feb 22, 2006 at 11:25:13AM +0000, David Given wrote:

On Wednesday 22 February 2006 06:36, Dave Dodge wrote:
[...]

For those who aren't familiar with tcc, the word "fast" is an
understatement.  tcc is so fast compared to a typical C compiler that
you can hardly believe it's actually compiling the code.

It also produces *extremely bad* code. At least for ARM.


Yes, one of the way it runs so quickly is to bypass optimizations that
other compilers perform.  It also does the compilation as a single
step directly from C code to object code, rather than breaking it
into distinct stages such as preprocessing and assembly.

The i386 backend is the most complete one, for example it's the only
backend that handles inline assembly.  The performance of the
resulting code on x86 really depends on what you're doing.  I've
actually seen a small test program where tcc produced noticably faster
code than gcc, but I'd consider that to be a fluke.

I find this sort of tool extremely interesting. For me the issue is not so much how slow is it compared to gcc, but how fast it is compared to Lua. Lua is 4-10 times faster than Javascript, perl and python. But 20-30 times slower than gcc (given the benchmarks that looked most illustrative to me). Where does tcc fit in there? I looked and found no performance numbers other than how fast it compiles (which is mildly curious, at best).

Has anyone applied any of the tests at:

    http://dada.perl.it/shootout/

to tcc, for instance?

--
chris marrin                ,""$,
chris@marrin.com          b`    $                             ,,.
                        mP     b'                            , 1$'
        ,.`           ,b`    ,`                              :$$'
     ,|`             mP    ,`                                       ,mm
   ,b"              b"   ,`            ,mm      m$$    ,m         ,`P$$
  m$`             ,b`  .` ,mm        ,'|$P   ,|"1$`  ,b$P       ,`  :$1
 b$`             ,$: :,`` |$$      ,`   $$` ,|` ,$$,,`"$$     .`    :$|
b$|            _m$`,:`    :$1   ,`     ,$Pm|`    `    :$$,..;"'     |$:
P$b,      _;b$$b$1"       |$$ ,`      ,$$"             ``'          $$
 ```"```'"    `"`         `""`        ""`                          ,P`
"As a general rule,don't solve puzzles that open portals to Hell"'