From 2b63dfd71784dbaa3e56258257d87b8964e5594b Mon Sep 17 00:00:00 2001 From: konsti Date: Fri, 28 Jun 2024 16:45:30 +0200 Subject: [PATCH] Log fork timings (#4618) This includes a functional change, we now skip the forked state pop/push if we didn't fork. From transformers: ``` DEBUG Pre-fork split universal took 0.036s DEBUG Split python_version >= '3.10' and python_version >= '3.10' and platform_system == 'Darwin' and python_version >= '3.11' and python_version >= '3.12' and python_version >= '3.6' and platform_system == 'Linux' and platform_machine == 'aarch64' took 0.048s DEBUG Split python_version <= '3.9' and platform_system == 'Darwin' and platform_machine == 'arm64' and python_version >= '3.7' and python_version >= '3.8' and python_version >= '3.9' took 0.038s ``` The messages could use simplification from https://github.com/astral-sh/uv/issues/4536 We can consider nested spans in the future but this works nicely for now. --- crates/uv-resolver/src/resolver/mod.rs | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/crates/uv-resolver/src/resolver/mod.rs b/crates/uv-resolver/src/resolver/mod.rs index 1c116c600..efb15a9ed 100644 --- a/crates/uv-resolver/src/resolver/mod.rs +++ b/crates/uv-resolver/src/resolver/mod.rs @@ -5,6 +5,7 @@ use std::collections::{BTreeMap, VecDeque}; use std::fmt::{Display, Formatter}; use std::ops::Bound; use std::sync::Arc; +use std::time::Instant; use std::{iter, thread}; use dashmap::DashMap; @@ -336,6 +337,7 @@ impl ResolverState ResolverState ResolverState { state.add_package_version_dependencies( @@ -560,7 +567,7 @@ impl ResolverState ResolverState ResolverState