forked from denoland/deno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: improve async op santizer speed and accuracy (denoland#20501)
This commit improves async op sanitizer speed by only delaying metrics collection if there are pending ops. 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.
- Loading branch information
1 parent
bf07604
commit 430b63c
Showing
12 changed files
with
185 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Check [WILDCARD]/cli/tests/testdata/test/ops_sanitizer_step_leak.ts | ||
running 1 test from ./cli/tests/testdata/test/ops_sanitizer_step_leak.ts | ||
timeout ... | ||
step ... ok [WILDCARD] | ||
------- output ------- | ||
done | ||
----- output end ----- | ||
timeout ... ok [WILDCARD] | ||
|
||
ok | 1 passed (1 step) | 0 failed [WILDCARD] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Deno.test("timeout", async (t) => { | ||
const timer = setTimeout(() => { | ||
console.log("timeout"); | ||
}, 10000); | ||
clearTimeout(timer); | ||
await t.step("step", async () => { | ||
await new Promise<void>((resolve) => setTimeout(() => resolve(), 10)); | ||
}); | ||
console.log("done"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.