From 2af0daceb320b59d13e312c6c9b65ae04e7a615b Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Wed, 12 Jul 2017 15:21:43 -0400 Subject: [PATCH 1/2] Remove @keep support from linker And everything else. This is a big (important) change; it addresses one of the greatest pains of the system. Keeps were added during the DSL rewrite (to support symbols and such) to work around the issue that there was no symbol-driven map; it allowed symbols to persist disjoint from the `__yield' dependency graph so that they could be mapped back and used by external systems. The problem with that is that it's both messy (coupling the concept of external dependencies with the actual code) and difficult to work with. It had a huge performance impact on the linker for two reasons: - Checking whether a package had already been seen and importing the keeps on first visit was expensive because of tree searching and manipulation; and - _every_ keep was imported and processed by the linker, even if it wouldn't end up being used by a particular program. The later especially had huge performance impacts on the entire system. The entire dependency graph is now map-driven, with the exception of the implicit `__yield' (which will eventually be moved into the map as well and the magic `lv:yield' removed in favor of a template). Performance-wise: our largest program ("dwelling") has many thousands of symbols and the largest package imported the majority of them, many of them unneeded, as the result of @keep subgraphs. Compilation of the largest package within that (for the UI) took about a minute and a half and ate up ~6GiB of RAM, for what really is a trivial task of resolving externs, some basic symbol processing, a topological sort, and ordering code fragments. After this change, it takes ~15s and less than 2GiB of RAM. Still a lot---and more improvements can be made---but much, much better. @keep and friends was left in rater.xsd so that nothing breaks while code is cleaned up; it'll be removed in the future. * src/current/compiler/linker.xsl: Remove @keep support. * src/current/dot/attr-keep.xsl: Remove now-unneeded template. * src/current/dot/defnode.xsl: Remove @keep and related. * src/current/include/preproc/eligclass.xsl: Remove @keep and related. * src/current/include/preproc/expand.xsl: Remove @keep and related. * src/current/include/preproc/macros.xsl: Remove @keep and related. * src/current/include/preproc/symtable.xsl: Remove @keep and related. * src/current/rater.xsd: Add TODO to remove @keep and friends. --- src/current/compiler/linker.xsl | 184 ++-------------------- src/current/dot/attr-keep.xsl | 50 ------ src/current/dot/defnode.xsl | 1 - src/current/include/preproc/eligclass.xsl | 5 - src/current/include/preproc/expand.xsl | 5 - src/current/include/preproc/macros.xsl | 4 +- src/current/include/preproc/symtable.xsl | 29 +--- src/current/rater.xsd | 2 +- 8 files changed, 24 insertions(+), 256 deletions(-) delete mode 100644 src/current/dot/attr-keep.xsl diff --git a/src/current/compiler/linker.xsl b/src/current/compiler/linker.xsl index 23cef9ae..93eb0944 100644 --- a/src/current/compiler/linker.xsl +++ b/src/current/compiler/linker.xsl @@ -181,23 +181,21 @@ symbol, then it must not be used); note that lv:yield actually compiles into a special symbol ___yield --> - + + - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + $existing[ not( @name = $cur/@name ) ]" /> @@ -622,7 +550,7 @@ symbol name is not unique: ` - ' found in + ' found in @@ -805,20 +733,13 @@ - - - - diff --git a/src/current/dot/attr-keep.xsl b/src/current/dot/attr-keep.xsl deleted file mode 100644 index d2776748..00000000 --- a/src/current/dot/attr-keep.xsl +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - red - - - - - - - - - - diff --git a/src/current/dot/defnode.xsl b/src/current/dot/defnode.xsl index 1cf6501a..6e350df3 100644 --- a/src/current/dot/defnode.xsl +++ b/src/current/dot/defnode.xsl @@ -92,7 +92,6 @@ - diff --git a/src/current/include/preproc/eligclass.xsl b/src/current/include/preproc/eligclass.xsl index 5fc9353e..974fb7a2 100644 --- a/src/current/include/preproc/eligclass.xsl +++ b/src/current/include/preproc/eligclass.xsl @@ -101,11 +101,6 @@ - - - - - diff --git a/src/current/include/preproc/expand.xsl b/src/current/include/preproc/expand.xsl index c8b24598..f023df15 100644 --- a/src/current/include/preproc/expand.xsl +++ b/src/current/include/preproc/expand.xsl @@ -500,11 +500,6 @@ - - - - - diff --git a/src/current/include/preproc/macros.xsl b/src/current/include/preproc/macros.xsl index dd836c9d..8d991a49 100644 --- a/src/current/include/preproc/macros.xsl +++ b/src/current/include/preproc/macros.xsl @@ -461,9 +461,7 @@ - - + diff --git a/src/current/include/preproc/symtable.xsl b/src/current/include/preproc/symtable.xsl index e9a7c619..432c3abd 100644 --- a/src/current/include/preproc/symtable.xsl +++ b/src/current/include/preproc/symtable.xsl @@ -517,7 +517,6 @@ - @@ -593,7 +592,7 @@ - + @@ -633,23 +632,6 @@ - - - - - - - - - - - - - - @@ -663,7 +645,7 @@ @@ -706,7 +688,7 @@ - @@ -718,10 +700,9 @@ - @@ -733,7 +714,7 @@ to avoid scanning separate object files for such common information) --> - diff --git a/src/current/rater.xsd b/src/current/rater.xsd index d1bac472..f27d75a7 100644 --- a/src/current/rater.xsd +++ b/src/current/rater.xsd @@ -1,5 +1,5 @@ - + Date: Wed, 12 Jul 2017 15:42:53 -0400 Subject: [PATCH 2/2] macros.xsl: Remove unnused param boolean class generation A classification used to be generated for each param for convenience; this has been deprecated by the progui package generation (when `q:' is used). * src/current/include/preproc/macros.xsl: Remove template. --- src/current/include/preproc/macros.xsl | 34 -------------------------- 1 file changed, 34 deletions(-) diff --git a/src/current/include/preproc/macros.xsl b/src/current/include/preproc/macros.xsl index 8d991a49..e58f247c 100644 --- a/src/current/include/preproc/macros.xsl +++ b/src/current/include/preproc/macros.xsl @@ -434,38 +434,4 @@ - - - - - - - - - - - - - - - - - - - - - - - -