| Deutsch English Français Italiano |
|
<20241205154533.000055ec@yahoo.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Michael S <already5chosen@yahoo.com> Newsgroups: comp.lang.c Subject: Re: question about linker Date: Thu, 5 Dec 2024 15:45:33 +0200 Organization: A noiseless patient Spider Lines: 108 Message-ID: <20241205154533.000055ec@yahoo.com> References: <vi54e9$3ie0o$1@dont-email.me> <vihpjh$2hgg1$1@dont-email.me> <vihrh1$2hk5l$1@dont-email.me> <vii0jp$2jkd9$1@dont-email.me> <viifv8$2opi7$1@dont-email.me> <vik28b$390eg$1@dont-email.me> <vik8tc$3ang9$1@dont-email.me> <vikjff$3dgvc$1@dont-email.me> <viku00$3gamg$1@dont-email.me> <vil0qc$3fqqa$3@dont-email.me> <vil82t$3ie9o$2@dont-email.me> <vila9j$3j4dg$1@dont-email.me> <vin4su$49a6$1@dont-email.me> <vinuhv$cc1d$1@dont-email.me> <jQ%3P.63776$vLg2.20433@fx17.iad> <viqfod$13esp$2@dont-email.me> <U_44P.55777$A9x9.10431@fx13.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Date: Thu, 05 Dec 2024 14:44:41 +0100 (CET) Injection-Info: dont-email.me; posting-host="1a962a3110763485291b4ca8f9912416"; logging-data="1111400"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+7Bg5mxuvDYskG9nGnkXO5t5EyyymOzBQ=" Cancel-Lock: sha1:PVX9uiPXXVRYdEfN/eG63kOlYD4= X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32) Bytes: 5792 On Wed, 04 Dec 2024 22:48:20 GMT scott@slp53.sl.home (Scott Lurndal) wrote: > David Brown <david.brown@hesbynett.no> writes: > >On 04/12/2024 17:55, Scott Lurndal wrote: =20 > >> Bart <bc@freeuk.com> writes: =20 > >>> On 03/12/2024 14:34, David Brown wrote: =20 > >>>> On 02/12/2024 22:53, Bart wrote: =20 > >>> =20 > >>>> For the project-specific code, rather than libraries, SDK, etc.: > >>>> > >>>> --------------------------------------------------------------------= --- > >>>> Language=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 files=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bl= ank=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 comment > >>>> =C2=A0 code > >>>> --------------------------------------------------------------------= --- > >>>> C++=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 39=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2217=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1020 > >>>> 11820 C/C++ Header=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 44=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 1078=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 798 > >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2696 C=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 3=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 259 > >>>> =C2=A0 237=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 1152 > >>>> --------------------------------------------------------------------= --- > >>>> SUM:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 86=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 3554=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 2055 > >>>> 15668 > >>>> --------------------------------------------------------------------= ----=20 > >>> =20 > >>>> Not that it really matters, but a typical build for my project > >>>> takes about 1 to 3 seconds. =20 > >>> > >>> I don't really know what they means, because I don't know is > >>> involved, and what is being missed out. > >>> > >>> So, to get an idea of how long gcc really takes (or would take on > >>> my machine), I set up a comparable test. I took an 800-line C > >>> program, and duplicated it in 200 separate files f1.c to f200.c, > >>> for a total line count of 167Kloc. > >>> > >>> gcc took 30 to 90 seconds to create an EXE using -O0 and -O2. > >>> > >>> Under WSL, it took 18 to 54 seconds 'real time' (to .o files; it > >>> can't link due to Win32 imports). > >>> > >>> Tiny C took 0.64 seconds. =20 > >>=20 > >> Here's a typical build for my project: > >>=20 > >> $ make -s -j 64 > >> ... > >>=20 > >> COMPILE apc2.cpp > >> COMPILE bcp2.cpp > >> BUILD /scratch/lib/libdevice_yyy.so > >> XXXX_BUILT > >> BUILDSO /scratch/libxxxx.so.1.0 > >> BUILD TARGET /scratch/bin/xxxx > >> COMPILE shim.cpp > >>=20 > >> real 13m48.24s > >> user 1h2m9.78s > >> sys 0m56.73s > >>=20 > >> 13 minutes by the wall clock, a bit over an hour > >> of CPU time. > >> =20 > > > >Is that a "typical" build - or an atypical full clean build? > > =20 >=20 > That was a build that touched a key header file, so maybe > 85% full. A full build adds a minute or two wall time. >=20 > A single source file build (for most source files) takes > about 28 seconds real, a large portion of that in make as it > figures out what to rebuild in a project with thousands > of source files and associated dependencies. LLVM/clang or gcc? Sounds like you can benefit both from faster compiler and from faster make utility. Also it sounds likely that you are already benefiting from faster linker. Which was created by google guy (Ian Lance Taylor) despite that back then prevailing opinion among people that share your attitude was that gnu ld is o.k. and at most need small tweaks. BTW, can you experiment with -O0 ? What speedup does it provide over -O2 in the project as big as yours?