[Top][All Lists]

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

Re: [Tinycc-devel] Tcc and Linux Kernel

From: Dave Dodge
Subject: Re: [Tinycc-devel] Tcc and Linux Kernel
Date: Thu, 27 Jan 2005 06:16:57 -0500
User-agent: Mutt/1.4.2i

On Thu, Jan 27, 2005 at 02:32:55PM +0530, abhijits wrote:
> This might sound a often repeated question or a useless question  but 
> has someone compiled linux kernel 2.4.18 with tcc

tccboot does uses tcc to compile the Linux kernel, though I'm not sure
which version of the kernel:


> and has someone seen how much is the reduction is kernel
> size  (observed.).

tcc's big feature is that the _compiler_ is small and extremely fast,
not that it necessarily produces the smallest and fastest output.

For example I just tried compiling some sample projects I have here.
gcc 3.4.2 takes 8 seconds to compile and link one of them; while tcc
does the same in only 0.2 seconds.  In another case, it's 17.3 seconds
for gcc and only 1.2 seconds for tcc.  The tccboot project
demonstrates this compile speed by using tcc to boot the Linux kernel
directly from sourcecode.

In the cases I just tried tcc did produce smaller executables than gcc.
I don't know if that's typical.  I tend to use lots of inlining and
include debugging symbols in the output when using gcc, and in that
situation tcc could easily produce smaller object code.

> Also has some performance comparison done for the same.

I would normally expect tcc's output to be slower than gcc's, simply
because it does not do as much in the way of optimzation.  A quick
test of one benchmark here (a fixed number of mostly integer
operations on a Celeron) finishes in 1.7 seconds using gcc's output,
but takes 4.6 seconds (more than 2.5 times as long) using tcc's

On the other hand, I have also seen small test cases where tcc
produced dramatically faster code than gcc, for no obvious reason.

                                                  -Dave Dodge

reply via email to

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