help JVM to cope with large symbolic structures;
authorwenzelm
Tue, 19 Feb 2013 20:19:21 +0100
changeset 51223 c6a8a05ff0a0
parent 51222 8c3e5fb41139
child 51224 c3e99efacb67
help JVM to cope with large symbolic structures;
src/Pure/PIDE/xml.scala
src/Pure/Tools/build.scala
--- a/src/Pure/PIDE/xml.scala	Tue Feb 19 17:55:26 2013 +0100
+++ b/src/Pure/PIDE/xml.scala	Tue Feb 19 20:19:21 2013 +0100
@@ -188,6 +188,7 @@
 
     // main methods
     def cache_string(x: String): String = synchronized { _cache_string(x) }
+    def cache_props(x: Properties.T): Properties.T = synchronized { _cache_props(x) }
     def cache_markup(x: Markup): Markup = synchronized { _cache_markup(x) }
     def cache_tree(x: XML.Tree): XML.Tree = synchronized { _cache_tree(x) }
     def cache_body(x: XML.Body): XML.Body = synchronized { _cache_body(x) }
--- a/src/Pure/Tools/build.scala	Tue Feb 19 17:55:26 2013 +0100
+++ b/src/Pure/Tools/build.scala	Tue Feb 19 20:19:21 2013 +0100
@@ -569,11 +569,15 @@
   def parse_log(full_stats: Boolean, text: String): Log_Info =
   {
     val lines = split_lines(text)
+    val xml_cache = new XML.Cache()
+    def parse_lines(prfx: String): List[Properties.T] =
+      Props.parse_lines(prfx, lines).map(xml_cache.cache_props)
+
     val name =
       lines.find(_.startsWith(SESSION_NAME)).map(_.substring(SESSION_NAME.length)) getOrElse ""
-    val stats = if (full_stats) Props.parse_lines("\fML_statistics = ", lines) else Nil
-    val tasks = if (full_stats) Props.parse_lines("\ftask_statistics = ", lines) else Nil
-    val command_timings = Props.parse_lines("\fcommand_timing = ", lines)
+    val stats = if (full_stats) parse_lines("\fML_statistics = ") else Nil
+    val tasks = if (full_stats) parse_lines("\ftask_statistics = ") else Nil
+    val command_timings = parse_lines("\fcommand_timing = ")
     val session_timing = Props.find_parse_line("\fTiming = ", lines) getOrElse Nil
     Log_Info(name, stats, tasks, command_timings, session_timing)
   }