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

Faster test suite #243

Closed
wants to merge 5 commits into from
Closed

Faster test suite #243

wants to merge 5 commits into from

Conversation

xavierleroy
Copy link
Contributor

The test suite takes significant time to run. This is annoying when testing on small devices (Raspberry Pi) or, even worse, using emulators (QEMU).

This pull request reduces the running time of the test suite by

  • Simplifying some tests that were initially designed as benchmarks, e.g. misc-kb. For benchmarking purposes, the test was repeated several times. A single run is enough for testing purposes.
  • Reducing the size of the data sets for some other tests.

With the proposed changes, almost every test run in 1 second or less (in bytecode as well as in native code) on a modern PC. The exception is tests/lib-threads, which still takes a long time (about 1 minute), and needs to be redesigned and rewritten.

For some tests, we reduce the size of the data sets.
For some other tests that started as benchmarks, we avoid repeating the test needlessly.


git-svn-id: http://caml.inria.fr/svn/ocaml/branches/faster-testsuite@16440 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
@gasche
Copy link
Member

gasche commented Sep 22, 2015

On my machine, the testsuite before this patch takes about 3m30s to run (when already hot), while after the patch it only takes 2m20s. For reference, make world.opt -j5 from a clean state takes 1m11s. I'm in favor of this change, as running the testsuite can be a bottleneck of my merge-rebase-test-commit cycle during pull request integration work.

(Eventually we'll want to be able to run some of the tests in parallel to further gain speed on beefy machines, but this requires a more invasive redesign of the testsuite scripts. make clean is also much slower than necessary due to the recursive make profusion.)

Not tested under Windows.
Some tests are still timing-sensitive and could fail if the test machine is under very heavy load.



git-svn-id: http://caml.inria.fr/svn/ocaml/branches/faster-testsuite@16446 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
@xavierleroy
Copy link
Contributor Author

The latest commits revise tests/lib-threads so that it takes less time (30 secs instead of 1 minute) and (one can hope) is more reliable (less sensitive to timing effects). Not tested under Windows, however.

@gerdstolpmann
Copy link

fyi, I was also working on the test suite, in particular I want to support cross-compile targets. The idea is to compile all tests into a single binary that is started as a TCP server on the device. The compilation and scripting still takes place on the host. So far it mostly works by providing additional Makefile targets. It's not yet finished, but one of the problems is that there are too many special tests (i.e. neither using Makefile.several or Makefile.one). If that could be improved this would be great.

Find my work here: https://github.com/gerdstolpmann/ocaml/tree/gs-4.02.3%2Bios%2Btestsuite/testsuite

@gasche
Copy link
Member

gasche commented Oct 3, 2015

@xavierleroy , do you plan to merge this in trunk eventually? I've been doing my stuff-to-merge testing on top of this branch, and it would be convenient to have this directly in trunk because there are small conflicts ( against the french comment translation work, which changed stuff in tests/threads ).

If you think the current state is mergeable I can do it this week-end, with the other easy PRs.

@damiendoligez
Copy link
Member

Tested on MSVC-32 and mingw-64. OK for merging.

@damiendoligez damiendoligez self-assigned this Oct 8, 2015
@damiendoligez
Copy link
Member

Merged (rev 16466).

@xavierleroy xavierleroy deleted the faster-testsuite branch October 27, 2015 13:43
stedolan pushed a commit to stedolan/ocaml that referenced this pull request Feb 20, 2020
doc changes for wait_for and wait_until
mshinwell pushed a commit to mshinwell/ocaml that referenced this pull request Aug 19, 2020
We were generating a map of code ids to code by traversing the unit, but
the only caller of `compute_offsets` already has an `Exported_code.t` at
hand, so we can just use that and avoid a double traversal.
lthls pushed a commit to lthls/ocaml that referenced this pull request Sep 23, 2020
We were generating a map of code ids to code by traversing the unit, but
the only caller of `compute_offsets` already has an `Exported_code.t` at
hand, so we can just use that and avoid a double traversal.
lthls pushed a commit to lthls/ocaml that referenced this pull request Sep 23, 2020
We were generating a map of code ids to code by traversing the unit, but
the only caller of `compute_offsets` already has an `Exported_code.t` at
hand, so we can just use that and avoid a double traversal.
lthls pushed a commit to lthls/ocaml that referenced this pull request Sep 24, 2020
We were generating a map of code ids to code by traversing the unit, but
the only caller of `compute_offsets` already has an `Exported_code.t` at
hand, so we can just use that and avoid a double traversal.
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