summaryrefslogtreecommitdiff
path: root/cli/lsp/testing/execution.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-02-27 20:30:17 -0700
committerGitHub <noreply@github.com>2024-02-27 20:30:17 -0700
commit96cfe82664c07163930444e835437ea0c44e5332 (patch)
tree896f92b8bf4e569cf37adabf03e5a75ce8dbff58 /cli/lsp/testing/execution.rs
parent9b5d2f8c1bae498d78400c8e9263bcae6e521adf (diff)
perf(cli): reduce overhead in test registration (#22552)
- Removes the origin call, since all origins are the same for an isolate (ie: the main module) - Collects the `TestDescription`s and sends them all at the same time inside of an Arc, allowing us to (later on) re-use these instead of cloning. Needs a follow-up pass to remove all the cloning, but that's a thread that is pretty long to pull --------- Signed-off-by: Matt Mastracci <matthew@mastracci.com>
Diffstat (limited to 'cli/lsp/testing/execution.rs')
-rw-r--r--cli/lsp/testing/execution.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/lsp/testing/execution.rs b/cli/lsp/testing/execution.rs
index 5fd1feb5a..809d02456 100644
--- a/cli/lsp/testing/execution.rs
+++ b/cli/lsp/testing/execution.rs
@@ -324,8 +324,11 @@ impl TestRun {
while let Some((_, event)) = receiver.recv().await {
match event {
test::TestEvent::Register(description) => {
- reporter.report_register(&description);
- tests.write().insert(description.id, description);
+ for (_, description) in description.into_iter() {
+ reporter.report_register(description);
+ // TODO(mmastrac): we shouldn't need to clone here - we can re-use the descriptions
+ tests.write().insert(description.id, description.clone());
+ }
}
test::TestEvent::Plan(plan) => {
summary.total += plan.total;