diff --git a/helpers/rust/src/main.rs b/helpers/rust/src/main.rs index ad875bc..fbc819b 100644 --- a/helpers/rust/src/main.rs +++ b/helpers/rust/src/main.rs @@ -166,6 +166,8 @@ fn main() { ) .init(); + log::info!("Log level set to {}", log::max_level()); + if cli.no_derived && cli.only == Some(Action::Derived) { log::error!("--no-derived and --only=derived are mutually exclusive"); std::process::exit(1); diff --git a/helpers/rust/src/types/statistics.rs b/helpers/rust/src/types/statistics.rs index a8c59cf..dba1db9 100644 --- a/helpers/rust/src/types/statistics.rs +++ b/helpers/rust/src/types/statistics.rs @@ -75,6 +75,8 @@ impl DumpStatistics { } fn close_subclasses(&mut self) -> usize { + log::info!("Computing subclass closure"); + let mut added = 0; let direct_superclasses = self .classes @@ -85,6 +87,7 @@ impl DumpStatistics { while let Some(class) = class_queue.pop_front() { let record = self.classes.entry(class).or_default(); + let mut done = HashSet::new(); let mut superclasses = record .direct_superclasses .iter() @@ -93,10 +96,16 @@ impl DumpStatistics { while let Some(superclass) = superclasses.pop_front() { record.superclasses.insert(superclass); + done.insert(superclass); added += 1; if let Some(new_superclasses) = direct_superclasses.get(&superclass) { - superclasses.extend(new_superclasses.iter().cloned()); + superclasses.extend( + new_superclasses + .iter() + .filter(|superclass| !done.contains(superclass)) + .cloned(), + ); } } } @@ -116,6 +125,8 @@ impl DumpStatistics { }) .collect::>(); + log::info!("Found {} non-empty classes", classes.len()); + for (class, superclasses) in classes { for super_class in superclasses { let record = self.classes.entry(super_class).or_default();