tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] modern c++ compiler written in C (food for thought)


From: Christian Jullien
Subject: Re: [Tinycc-devel] modern c++ compiler written in C (food for thought)
Date: Thu, 29 Oct 2015 06:32:45 +0100

Ooops! Don't misunderstand me. No doubt to me, tcc *IS* a real C compiler and, even it does not have all optimization phases of its competitor, it does not behaves too bad.

I love its compilation speed and, with reasonable efforts, its code is understandable.

 

My only concern is to see efforts is to have C++ based on tcc. Cfront was made on an age where C standard was K&R (no const, no prototypes ...). C++ compilers evolved a lot to be smart enough to compile complex C++ code to something efficient.

 

Once again, I deeply respect the efforts to have a Cfront(tcc) working with minimal changes in Cfront source code 'just for the fun'. But, IMHO, it's a waste of time any attempt to do more. I bet the result will be used by nobody because poor performances and lack of support for more recent C++ features.

 

M2c.

 

Christian

 

PS. Here are my own benchmarks made on my Lisp compiler using different C compilers, tcc lack of optimization makes the Lisp compiler SLOWER than interpreter!!! I don’t want to imagine the performance loss on a C++ benchmark using Cfront(tcc). However, I repeat I LOVE tcc TRUE C Compiler :o)

 

GNU GCC 5.x (Mgw) Win32 (LAPtoCC) |  0.202

Microsoft C 18.0  Win32 (LAPtoCC) |  0.217

GNU GCC 5.x (Mgw) Win64 (LAPtoCC) |  0.237

Microsoft C 18.0  Win64 (LAPtoCC) |  0.237

Digital Mars 8.57 Win32 (LAPtoCC) |  0.248

Tiny C Compiler   Win32 (LAPtoCC) |  0.339

Tiny C Compiler   Win64 (LAPtoCC) |  0.382

GNU GCC 5.x (Mgw) Win32 (Compile) |  1.082

Watcom C 1.90     Win32 (Compile) |  1.142

Microsoft C 18.0  Win64 (Compile) |  1.216

Microsoft C 18.0  Win32 (Compile) |  1.253

Digital Mars 8.57 Win32 (Compile) |  1.353

LCC C Compiler    Win32 (Compile) |  1.467

GNU GCC 5.x (Mgw) Win64 (Compile) |  1.526

IBM Visual Age C  Win32 (Compile) |  1.580

Microsoft C 18.0  Win32 (32 bits) |  1.802

Microsoft C 18.0  Win32 (Unicode) |  1.819

Microsoft C 18.0  Win64 (64 bits) |  1.838

LCC C Compiler    Win64 (Compile) |  1.866

Microsoft C 18.0  Win64 (Unicode) |  2.084

GNU GCC 5.x (Mgw) Win32 (32 bits) |  2.274

GNU GCC 5.x (Mgw) Win64 (64 bits) |  2.373

Watcom C 1.90     Win32 (32 bits) |  2.703

IBM Visual Age C  Win32 (32 bits) |  2.859

Pelles C Compiler Win32 (32 bits) |  3.563

Digital Mars 8.57 Win32 (32 bits) |  3.630

LCC C Compiler    Win32 (32 bits) |  3.763

Pelles C Compiler Win64 (64 bits) |  4.071

LCC C Compiler    Win64 (64 bits) |  4.887

Tiny C Compiler   Win32 (32 bits) |  5.899

Tiny C Compiler   Win64 (64 bits) |  5.903

Tiny C Compiler   Win32 (Compile) | 10.500

Tiny C Compiler   Win64 (Compile) | 10.790

 

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Sergey Korshunoff
Sent: jeudi 29 octobre 2015 00:27
To: address@hidden
Subject: Re: [Tinycc-devel] modern c++ compiler written in C (food for thought)

 

Hi Christian Jullien!

> I'm really afraid to see discussion on about to optimize Cfront tcc backend!

There is no such discussion. But Basile and you trying to say tcc is not a real compiler, a tcc can not be used to perform some task. Only because it is not a optimizer compiler. This is not true. We don't need an optimizer compiler all the time. Some words from the MELT build instructions:

- 6 GByte of the RAM

- 20 minutes for build

Only because a C++ must be compiled

 

> It has the reputation to be slower than C and, in some sense, it is

> true when used by non-highly experimenter C++ programmers. (In real

> life, C++ can outperform C

> - I have code that run >2x as fast in C++ --thanks to templates-- than in C).

 

I looked in OW STL some words about comparison a C++ way programming with plain C: in some cases C++ slower a plain C by 1.5  It is not a fail of the "highly expnon-erimented C++ programmers". But yes: C++ can be as fast as a plain C if you don't use C++ features or use only a templates w/o classes.

 

PS: I can't fast find this article: a test  was a C way list and iterators against a C++ list, iterators and so...

 

_______________________________________________

Tinycc-devel mailing list

address@hidden

https://lists.nongnu.org/mailman/listinfo/tinycc-devel


reply via email to

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