clarified statistics;
authorwenzelm
Tue, 25 Jul 2023 12:27:31 +0200
changeset 78452 14ceb9a51e97
parent 78451 c32b8d5a9e07
child 78453 3fdf3c5cfa9d
clarified statistics;
src/Pure/Tools/profiling.scala
src/Tools/profiling.ML
--- a/src/Pure/Tools/profiling.scala	Mon Jul 24 22:53:18 2023 +0200
+++ b/src/Pure/Tools/profiling.scala	Tue Jul 25 12:27:31 2023 +0200
@@ -109,8 +109,8 @@
 
     val header0: List[String] =
       List(
-        "theories",
-        "garbage_theories%",
+        "named_theories",
+        "total_theories",
         "locales",
         "locale_thms",
         "global_thms",
@@ -142,8 +142,12 @@
     val types_size: Space = Space.zero,
     val spaces_size: Space = Space.zero
   ) {
-    def garbage_theories_percentage: Percentage =
-      percentage(garbage_theories, theories + garbage_theories)
+    private def print_total_theories: String =
+      if (theories == 0) "0"
+      else {
+        val x = (theories + garbage_theories).toDouble / theories
+        String.format(Locale.ROOT, "%.1f", x.asInstanceOf[AnyRef])
+      }
 
     private def size_percentage(space: Space): Percentage =
       percentage_space(space, heap_size)
@@ -154,7 +158,7 @@
     val fields0: List[Any] =
       List(
         theories,
-        garbage_theories_percentage.toString,
+        print_total_theories,
         locales,
         locale_thms,
         global_thms,
--- a/src/Tools/profiling.ML	Mon Jul 24 22:53:18 2023 +0200
+++ b/src/Tools/profiling.ML	Tue Jul 25 12:27:31 2023 +0200
@@ -116,7 +116,7 @@
           types = base_types, spaces = base_spaces} = session_content base_thys;
 
     val n = length loaded_thys;
-    val m = length loaded_context_thys - n;
+    val m = (case length loaded_context_thys of 0 => 0 | l => l - n);
   in
     {theories = n,
      garbage_theories = m,