From 96cfe82664c07163930444e835437ea0c44e5332 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Tue, 27 Feb 2024 20:30:17 -0700 Subject: 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 --- cli/lsp/testing/execution.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cli/lsp/testing/execution.rs') 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; -- cgit v1.2.3