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

perf: improve async op santizer speed and accuracy #20501

Merged
merged 9 commits into from
Sep 16, 2023

Conversation

lucacasonato
Copy link
Member

@lucacasonato lucacasonato commented Sep 14, 2023

This commit improves async op sanitizer speed by only delaying metrics
collection if there are op_sleep ops in the resource table. This
results in a speedup of around 30% for small CPU bound unit tests.

It performs this check and possible delay on every collection now,
fixing an issue with parent test leaks into steps. Fixes #20498

Before:

/m/a/P/g/d/deno ❯❯❯ deno test -A --unstable ./cli/tests/unit/abort_controller_test.ts
running 6 tests from ./cli/tests/unit/abort_controller_test.ts
basicAbortController ... ok (5ms)
signalCallsOnabort ... ok (4ms)
signalEventListener ... ok (3ms)
onlyAbortsOnce ... ok (4ms)
controllerHasProperToString ... ok (3ms)
abortReason ... ok (3ms)

ok | 6 passed | 0 failed (44ms)

After:

/m/a/P/g/d/deno ❯❯❯ ./target/release/deno test -A --unstable ./cli/tests/unit/abort_controller_test.ts
running 6 tests from ./cli/tests/unit/abort_controller_test.ts
basicAbortController ... ok (3ms)
signalCallsOnabort ... ok (2ms)
signalEventListener ... ok (1ms)
onlyAbortsOnce ... ok (1ms)
controllerHasProperToString ... ok (1ms)
abortReason ... ok (1ms)

ok | 6 passed | 0 failed (29ms)

@lucacasonato
Copy link
Member Author

The test failures are legit - some are bad tests, but the worker related ones are real. Working on a fix.

This commit improves async op sanitizer speed by only delaying metrics
collection if there are `op_sleep` ops in the resource table.

It performs this check and possible delay on every collection now,
fixing an issue with parent test leaks into steps.
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, no comments. Awesome improvement

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.

Test sanitizer incorrectly reports timeout as cancelled in a step, even if cancelled outside
2 participants