Sujet : Re: C23 thoughts and opinions
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 26. May 2024, 22:27:15
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v309fk$3jrtv$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
User-Agent : Mozilla Thunderbird
On 26/05/2024 21:26, Michael S wrote:
On Sun, 26 May 2024 19:01:21 +0100
bart <bc@freeuk.com> wrote:
On 26/05/2024 17:35, Michael S wrote:
On Sun, 26 May 2024 16:25:51 +0100
bart <bc@freeuk.com> wrote:
>
Back to the 5MB test:
>
Tiny C 1.7s 2.9MB/sec (Tcc doesn't use any IR)
>
mcc 3.7s 1.3MB/sec (my product; uses intermediate
ASM)
>
Faster than new MSVC, but slower than old MSVC.
>
My mcc is never going to be fast, because it uses ASM, which itself
will generate a text file several times larger than the C (so the
line "123," in C ends up as " db 123" in the ASM file).
>
Generation of asm at 7-8 MB/s sounds feasible even on slow computer.
And once you have asm in right format,
If I take the 5M-line data file, and use `gcc -S` on it, produces an ASM file where the bytes are combined into strings. Is that the 'trick'?
Then processing that ASM file can be faster.
However my ASM o/p doesn't create strings like that, and the ASM file is therefore five times the size.
Still, my assembler can turn my 72MB ASM file into a 5MB executable in 0.74 seconds (which is 100MB/sec).
'as' can turn its much smaller 15MB ASM (.s) file into an executable in 0.56 seconds (27MB/sec).
> 'gnu as' processes it quite fast.
Given the same input (ie. same set of instructions), my assembler is faster than 'as'. See this survey of assembler speeds here:
https://www.reddit.com/r/Compilers/comments/1c41y6d/assembler_survey/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_buttonMine is the 'AA' assembler.
The bottleneck here is writing the ASM file. But I don't care about that, since 'mcc' is not my primary compiler. My primary one doesn't use ASM.
But even with that bottleneck, mcc compiles this data file to EXE three times as fast as gcc.
My MM compiler can do so 17 times as fast as gcc. And with the optimisation I mentioned in a previous post (similar to as's trick), it could do so 35-40 times faster than gcc.