lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Common test objects are too common


From: Vadim Zeitlin
Subject: [lmi] Common test objects are too common
Date: Sun, 7 Mar 2021 13:30:01 +0100

 Hello,

 We currently have 72 tests using common_test_objects variable in
objects.make. This means that 6 files included in this variable are
compiled at least 432 times (but actually more because some of them are
also part of main_auxiliary_common_objects which accounts for another 10
compilations and all of them are also in common_common_objects which is
used twice).

 I understand that we live in the time of computer resources abundance and
so I've been successful so far with suppressing my dislike of gratuitous
inefficiency from surfacing because there are always more important things
to do, but after building the tests several times during the last few days,
I just can't do it any longer, so I'd like to point a few obvious problems
with the current approach:

0. Philosophical argument: compiling the same file over and over again is
   just completely useless and doing useless work unnecessarily is rarely
   the right thing to do.

1. Doing it takes time. This is important when building locally, and even
   more important for the CI builds which run on relatively slow hardware
   (and GitHub Actions runners use blazingly fast hardware compared to the
   other cloud providers I've used).

2. Doing it takes space. Each build directory is about 1GiB and this is a
   lot, even nowadays, compared with typical SSD sizes. The files in
   common_test_objects account for almost 100MiB which doesn't change
   anything fundamentally, but still accounts for a not insignificant share
   of the total.

3. Linking tests with random object files just seems sloppy. Unit tests
   ought to link with the same libraries as the real programs. It would
   seem to be very unlikely that their behaviour could depend on whether
   they compile the same code as is included in liblmi directly or link
   with it, but it's nevertheless not completely impossible. Why take the
   risk of testing something different from what is used in production?


 To summarize, I'd strongly prefer to link the tests with liblmi rather
than compiling (some) of its object files as part of the tests themselves.
I'm going to do it for autotools builds, i.e. in Makefile.am, before I run
out of space on my SSD, but I'd also like to do it in the official
makefiles. Would you accept a PR changing them too or do you have any
reasons to prefer the current way of doing things that I'm missing?

 Thanks in advance,
VZ

Attachment: pgp3YVmT76wx7.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]