Sujet : Re: else ladders practice
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.cDate : 19. Nov 2024, 20:11:03
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vhins8$1vuvp$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Mozilla Thunderbird
On 19/11/2024 15:51, Bart wrote:
On 19/11/2024 01:53, Waldek Hebisch wrote:
Another example, building 40Kloc interpreter from source then running it in memory:
c:\qx>tm \bx\mm -run qq hello
Compiling qq.m to memory
Hello, World! 19-Nov-2024 15:38:47
TM: 0.11
c:\qx>tm qq hello
Hello, World! 19-Nov-2024 15:38:49
TM: 0.05
The second version runs a precompiled EXE. So building from source added only 90ms.
Sorry, that should be 60ms. Running that interpreter from source only takes 1/16th of a second longer not 1/11th of a second.
BTW I didn't remark on the range of your (WH's) figures. They spanned 40 minutes for a build to instant, but it's not clear for which languages they are, which tools are used and which machines. Or how much work they have to do to get those faster times, or what work they don't do: I'm guessing it's not processing 0.5M lines for that fastest time.
So it was hard to formulate a response.
All my timings are either for C or my systems language, running on one core on the same PC.
For something that you can compare on your own machines, this is a test using a one-file version of Lua adapted from
https://github.com/edubart/minilua.
Timings and EXE sizes are:
Seconds KB
gcc -O0 -s 3.4 372
gcc -Os -s 8.5 241
gcc -O2 -s 11.7 328
gcc -O3 -s 14.4 378
tcc 0.9.27 0.14 384
cc 0.16 315 (My new C compiler)
cc 0.09 - (Compile to intepretable IL)
cc 0.11 - (Compile to IL then runnable in-mem code)
mcc 0.28 355 (My old C compiler uses intermediate ASM)
Since this is one file (of some tens of 1000s of KB; -E output varies), any mod involves recompiling the whole thing.