Liste des Groupes | Revenir à cl c |
On Sun, 26 May 2024 16:25:51 +0100
bart <bc@freeuk.com> wrote:
On 26/05/2024 14:18, Michael S wrote:
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).Are you talking about a 5MB array initialised like this:Yes.
>
unsigned char data[] = {
45,
67,
17,
... // 5M-3 more rows
};
>
The timing for 120M entries was challenging as it exceeded physicalThat's an interesting test as well, but I don't want to run it on my HW
memory. However that test I can also do with C compilers. Results for
120 million lines of data are:
>
DMC - Out-of-memory
>
Tiny C - Silently stopped after 13 second (I thought it
had finished but no)
>
lccwin32 - Insufficient memory
>
gcc 10.x.x - Out of memory after 80 seconds
>
mcc - (My product) Memory failure after 27 seconds
>
Clang - (Crashed after 5 minutes)
>
MM 144s (Compiler for my language)
>
So the compiler for my language did quite well, considering!
>
right now. May be, at night.
>Faster than new MSVC, but slower than old MSVC.
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)
All produce EXE files, via linkers if necessary, except Clang (its hefty LLVM installation doesn't come with standard C headers, nor a linker; it depends on MS tools, but never manages to sync with them).>That's quite impressive.
DMC -- -- (Out of memory; 32-bit compiler)
>
lccwin32 3.9s 1.3MB/sec
>
gcc 10.x 10.6s 0.5MB/sec
>
clang 7.4s 0.7MB/sec (to object file only)
>
MM 1.4s 3.6MB/sec (compiler for my language)
>
MM 0.7 7.1MB/sec (MM optimised via C and gcc-O3)
>
Does it generate object files or goes directly to exe?
Even if later, it's still impressive.So, it's more impressive if it first generates an OBJ file then invokes a linker? I'd have thought that eliminating that pointless intermediate step would be more impressive!
Funny that no one else has access to an implementation! Those figures have been around for a while.As a reminder, when using my version of 'embed' in my language,No, I just blindly believe the paper.
embedding a 120MB binary file took 1.3 seconds, about 90MB/second.
>
>But both are much faster than compiling through text. Even "slow">
40MB/3 is 6-7 times faster than the fastest of compilers in my
tests.
Do you have a C compiler that supports #embed?
>
But it probably would be available in clang this year and in gcc aroundThat's not quite what I meant. That conversion is the lexical part of processing source code, it can be very fast.
start of the next year. At least I hope so.
It's generally understood that processing text is slow, ifI don't think that conversion from text to binary is a significant
representing byte-at-a-time data. If byte arrays could be represented
as sequences of i64 constants, it would improve matters. That could
be done in C, but awkwardly, by aliasing a byte-array with an
i64-array.
>
bottleneck here.
Les messages affichés proviennent d'usenet.