On Sat, 09 Jan 2021 16:54:20 -0500, Dennis Lee Bieber wrote:
> On Sat, 9 Jan 2021 19:20:21 -0000 (UTC), Martin Gregorie
> declaimed the following:
>
>>Depends what the program is: Hello World in Java is 419 bytes (the C
>>version is 19554 bytes and the source is smaller too (21 lines, 147
>>chars vs 26 lines, 282 chars) and anyway I like the WORA principle
>>
>>
> And how big is the byte-code interpreter/JVM needed to /run/ that
Java
> example? Vs the directly executable C program?
The JVM loadable is 18376 bytes, so not exactly huge, but I don't know
how much, if any, dynamically loaded support code it drags in. But note
that this is smaller than the hello world program when compiled by the
current GCC compiler and statically linked.
But, as I said elsewhere a moderate sized graphical Java program (4000
lines of source code, not counting comments) that I wrote using the Swing
GUI occupies 1.3 GB after loading a typical working data set (6 6 month-
long rosters with 14 rosterable duties per day.
However, I should hardly need to remind you that C and C++ programs
aren't always exactly economical when it comes to load size: I remember
looking at this a long time back when Borland compilers were still a
thing. IIRC 'hello world' in ANSI C compiled to several 10s of Kbytes and
the C++ version compiled to 800Kb using the then current version of
Borland's finest.
--
--
Martin | martin at
Gregorie | gregorie dot org
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|