8000 optimize curve25519 for tests by Ekleog-NEAR · Pull Request #9606 · near/nearcore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

optimize curve25519 for tests #9606

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

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

Ekleog-NEAR
Copy link
Contributor
@Ekleog-NEAR Ekleog-NEAR commented Sep 27, 2023

This brings down the runtime of tests involving the runtime-tester by 40%, ie. 7.5s -> 4.5s for the runtime quickcheck added in #9602. Hopefully other tests will also profit from it, though I haven’t benchmarked it all.

The overall runtime on buildkite of the cargo test nightly not integration-tests* test seems, on a sample of 1, to be roughly the same (+- 10s) before addition of the test from #9602, so there should not be a significant delay in CI round-trip due to it, and it should mostly impact local development that rarely sees changes from dependencies.

@Ekleog-NEAR Ekleog-NEAR requested a review from a team as a code owner September 27, 2023 20:00
@Ekleog-NEAR Ekleog-NEAR requested a review from wacban September 27, 2023 20:00
@Ekleog-NEAR Ekleog-NEAR added the C-housekeeping Category: Refactoring, cleanups, code quality label Sep 27, 2023
This brings down the runtime of tests involving the runtime-tester by
40%, ie. 7.5s -> 4.5s. Hopefully other tests will also profit from it,
though I haven’t benchmarked it all.
@Ekleog-NEAR Ekleog-NEAR added this pull request to the merge queue Oct 2, 2023
Copy link
Contributor
@wacban wacban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late review, I was off. For my education, what are the pros and cons of this approach? Will that make compilation slower and by how much? Are there any other targets that would benefit from it?
LGTM but I'm not familiar with this area. If there is anyone who'd be better suited for review please ask them.

Merged via the queue into near:master with commit 7fd97ab Oct 2, 2023
@Ekleog-NEAR Ekleog-NEAR deleted the optimize-curve25519 branch October 2, 2023 11:16
nikurt pushed a commit that referenced this pull request Oct 2, 2023
This brings down the runtime of tests involving the runtime-tester by
40%, ie. 7.5s -> 4.5s for the runtime quickcheck added in #9602.
Hopefully other tests will also profit from it, though I haven’t
benchmarked it all.

The overall runtime on buildkite of the `cargo test nightly not
integration-tests*` test seems, on a sample of 1, to be roughly the same
(+- 10s) before addition of the test from #9602, so there should not be
a significant delay in CI round-trip due to it, and it should mostly
impact local development that rarely sees changes from dependencies.
nikurt pushed a commit that referenced this pull request Oct 2, 2023
This brings down the runtime of tests involving the runtime-tester by
40%, ie. 7.5s -> 4.5s for the runtime quickcheck added in #9602.
Hopefully other tests will also profit from it, though I haven’t
benchmarked it all.

The overall runtime on buildkite of the `cargo test nightly not
integration-tests*` test seems, on a sample of 1, to be roughly the same
(+- 10s) before addition of the test from #9602, so there should not be
a significant delay in CI round-trip due to it, and it should mostly
impact local development that rarely sees changes from dependencies.
nikurt pushed a commit that referenced this pull request Oct 11, 2023
This brings down the runtime of tests involving the runtime-tester by
40%, ie. 7.5s -> 4.5s for the runtime quickcheck added in #9602.
Hopefully other tests will also profit from it, though I haven’t
benchmarked it all.

The overall runtime on buildkite of the `cargo test nightly not
integration-tests*` test seems, on a sample of 1, to be roughly the same
(+- 10s) before addition of the test from #9602, so there should not be
a significant delay in CI round-trip due to it, and it should mostly
impact local development that rarely sees changes from dependencies.
@Ekleog-NEAR
Copy link
Contributor Author

what are the pros and cons of this approach? Will that make compilation slower and by how much?

The pro is basically tests run faster. The con is that whenever the dependency changes, we need to optimize it, and so the rebuilds take more time.

Usually for dependencies that are not on a hot path, the added compilation time is not worth the test speedup. However, as soon as a dependency takes a significant amount of time, optimizing it can significantly improve on the compile-and-test cycle speed, especially because we most often compile-and-test much more often than we actually bump dependencies.

However, CI is usually mostly unaffected by these changes, because it needs to rebuild the whole thing each time, and so needs to pay the compilation cost each time. However, for the hottest-path dependencies, it can still get faster. This is not the case in this PR, as buildkite showed basically no changes in the overall time taken to build.

Are there any other targets that would benefit from it?

I’m currently investigating this, just opened #9671 and am looking at a few other promising targets. However, this very much depends on which places we usually compile-and-test, and I’m checking mostly the full test suite, integration-tests and a few crates that seemed big to me.

So if you often run some specific test suite and find it slow, it’s probably worth running samply on it once and looking at whether there’s an obvious dependency that could be optimized to make your command faster, as the cost of optimizing a single dependency is usually not that big :)

Ekleog-NEAR added a commit to Ekleog-NEAR/nearcore that referenced this pull request Oct 12, 2023
The runtime of the whole test suite gets down by ~2.5% with this change.
Integration tests get a similar speedup.
CI times will be confirmed to not have too much change by it running on this PR.

See also near#9606.
Ekleog-NEAR added a commit to Ekleog-NEAR/nearcore that referenced this pull request Oct 12, 2023
The runtime of the whole test suite gets down by ~2.5% with this change.
Integration tests get a similar speedup.
CI times will be confirmed to not have too much change by it running on this PR.

See also near#9606.
Ekleog-NEAR added a commit to Ekleog-NEAR/nearcore that referenced this pull request Oct 12, 2023
The runtime of the whole test suite gets down by ~2.5% with this change.
Integration tests and near-vm-runner get a ~3.5% speedup.

CI times will be confirmed to not have too much change by it running on this PR.

See also near#9606.
github-merge-queue bot pushed a commit that referenced this pull request Oct 13, 2023
The runtime of the whole test suite gets down by ~2.5% with this change.
Integration tests get a similar speedup.
CI times will be confirmed to not have too much change by it running on
this PR.

See #9606.
Ekleog-NEAR added a commit to Ekleog-NEAR/nearcore that referenced this pull request Oct 13, 2023
The runtime of the whole test suite gets down by ~2% with this change.

Integration tests and near-vm-runner also get a similar speedup.

CI times will be confirmed to not have too much change by it running on this PR.

See also near#9606.
github-merge-queue bot pushed a commit that referenced this pull request Oct 13, 2023
The runtime of the whole test suite gets down by ~2.5% with this change.
Integration tests get a similar speedup.
CI times will be confirmed to not have too much change by it running on
this PR.

See also #9606.
github-merge-queue bot pushed a commit that referenced this pull request Oct 13, 2023
The runtime of the whole test suite gets down by ~2% with this change.

Integration tests and near-vm-runner also get a similar speedup.

CI times will be confirmed to not have too much change by it running on
this PR.

See also #9606.
nikurt pushed a commit that referenced this pull request Oct 16, 2023
The runtime of the whole test suite gets down by ~2.5% with this change.
Integration tests get a similar speedup.
CI times will be confirmed to not have too much change by it running on
this PR.

See #9606.
nikurt pushed a commit that referenced this pull request Oct 16, 2023
The runtime of the whole test suite gets down by ~2.5% with this change.
Integration tests get a similar speedup.
CI times will be confirmed to not have too much change by it running on
this PR.

See also #9606.
nikurt pushed a commit that referenced this pull request Oct 16, 2023
The runtime of the whole test suite gets down by ~2% with this change.

Integration tests and near-vm-runner also get a similar speedup.

CI times will be confirmed to not have too much change by it running on
this PR.

See also #9606.
nikurt pushed a commit that referenced this pull request Oct 20, 2023
The runtime of the whole test suite gets down by ~2.5% with this change.
Integration tests get a similar speedup.
CI times will be confirmed to not have too much change by it running on
this PR.

See #9606.
nikurt pushed a commit that referenced this pull request Oct 20, 2023
The runtime of the whole test suite gets down by ~2.5% with this change.
Integration tests get a similar speedup.
CI times will be confirmed to not have too much change by it running on
this PR.

See also #9606.
nikurt pushed a commit that referenced this pull request Oct 20, 2023
The runtime of the whole test suite gets down by ~2% with this change.

Integration tests and near-vm-runner also get a similar speedup.

CI times will be confirmed to not have too much change by it running on
this PR.

See also #9606.
nikurt pushed a commit that referenced this pull request Oct 20, 2023
The runtime of the whole test suite gets down by ~2.5% with this change.
Integration tests get a similar speedup.
CI times will be confirmed to not have too much change by it running on
this PR.

See #9606.
nikurt pushed a commit that referenced this pull request Oct 20, 2023
The runtime of the whole test suite gets down by ~2.5% with this change.
Integration tests get a similar speedup.
CI times will be confirmed to not have too much change by it running on
this PR.

See also #9606.
nikurt pushed a commit that referenced this pull request Oct 20, 2023
The runtime of the whole test suite gets down by ~2% with this change.

Integration tests and near-vm-runner also get a similar speedup.

CI times will be confirmed to not have too much change by it running on
this PR.

See also #9606.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-housekeeping Category: Refactoring, cleanups, code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0