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

[doctest] reduce doctest setup time #14111

Merged
merged 6 commits into from
Jan 4, 2024
Merged

Conversation

danking
Copy link
Contributor

@danking danking commented Dec 21, 2023

Before this change, testing just the n_partitions method of Table takes nearly a minute, 52s of which is spent in "setup". Admittedly, this setup is shared across multiple tests, but this is an unacceptable burden for iterating on one method.

52.30s setup    hail/table.py::hail.table.Table.n_partitions
3.07s call     hail/table.py::hail.table.Table.n_partitions

After this change, the setup time significantly reduces. The call gets slower, presumably because the JVM is not warm. I think the setup time is now dominated by Hail JVM initialization.

11.77s call     hail/table.py::hail.table.Table.n_partitions
9.68s setup    hail/table.py::hail.table.Table.n_partitions

This reduces the practical runtime of this test by 50%.

This commit adds 72kB to the repository:

$ git diff-tree -r -c -M -C --no-commit-id HEAD | awk '{print $4}' | git cat-file --batch-check | awk 'BEGIN {s=0} {s+= $3} END {print s}'
72998

Before this change, testing just the n_partitions method of Table takes nearly a minute, 52s of
which is spent in "setup". Admittedly, this setup is shared across multiple tests, but this is an
unacceptable burden for iterating on one method.

```
52.30s setup    hail/table.py::hail.table.Table.n_partitions
3.07s call     hail/table.py::hail.table.Table.n_partitions
```

After this change, the setup time significantly reduces. The call gets slower, presumably because
the JVM is not warm. I think the setup time is now dominated by Hail JVM initialization.

```
11.77s call     hail/table.py::hail.table.Table.n_partitions
9.68s setup    hail/table.py::hail.table.Table.n_partitions
```
This reduces the practical runtime of this test by 50%.

This commit adds 72kB to the repository:

```
$ git diff-tree -r -c -M -C --no-commit-id HEAD | awk '{print $4}' | git cat-file --batch-check | awk 'BEGIN {s=0} {s+= $3} END {print s}'
72998
```
@danking
Copy link
Contributor Author

danking commented Jan 4, 2024

bump

@danking danking merged commit 7d51533 into hail-is:main Jan 4, 2024
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.

2 participants