Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize incremental builds #5969

Merged
merged 9 commits into from
Sep 9, 2024

Conversation

edwintorok
Copy link
Contributor

This doesn't yet result in an improvement in koji build times, but it reduces incremental build times, by:

  • reducing the running time of certain tests either by reducing iteration counts (we'll run the full in quicktest)
  • optimizing the test code to eliminate hot spots

If you change source files that are in the dependency tree of these tests then a dune runtest will be quicker too.
An uncached dune runtest from a clean build takes ~1m33s now (a Koji build takes ~5m, so we spend more time unpacking, installing dependencies and packing than building).

We could further reduce build times by reducing the amount of files that we package (most libraries are only used inside XAPI, etc.) but that will be the subject of a future PR.

@robhoes
Copy link
Member

robhoes commented Sep 9, 2024

@edwintorok There is a conflict now after merging another PR. Could you update this and then merge?

Tell dune which directories don't contain dune files,
so it can avoid scanning them.

They can still be used as dependencies though.

Unit test input data is particularly large for example.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
This is a followup for:
Fixes: f07b9d7 ("[maintenance]: preprocess only modules containing @@deriving")

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
The 'source_tree test_data' dependency also applied to the test executable.
However this is only a runtime dependency, so split the rule and express the more granular dependency.

Now 'dune build @check' creates a _build with 9185 files.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
We'll run the longer version in quicktests, using the QCHECK_LONG_FACTOR.

Now the test takes ~3s to run instead of ~20s.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Alcotest.check prints the message to stdout and flushes the formatter.
This is called in a loop a million times, so this generates a lot of output,
and is very slow.
Use an empty message instead, which has an optimization in alcotest to avoid the formatter flushing,
and set ~pos instead so that we get a unique error on failure.

The test now takes 1.2s instead of 15s.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
The proxy and time limited read tests took ~10s, they now take ~2s.

A longer test will be run in quicktest with QCHECK_LONG_FACTOR.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Use ~pos:__POS__ "" instead of __LOC__ in Alcotest.check.

This only prints the position on failure, previously __LOC__ was printed on success too.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Port this commit to concur-rpc-test.sh:
62ff5e7 ("[maintenance]: reduce basic-rpc-test time")

Reduces time from ~33s to ~10s.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Instead of comparing byte by byte use the more efficient comparison function
that cstruct provides.

This speeds up the test (from ~40s to ~33s).

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
@edwintorok edwintorok merged commit cb1d3a2 into xapi-project:master Sep 9, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants