Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2017-07-12 15:21:43 -0400
committerMike Gerwitz <gerwitzm@lovullo.com>2017-07-12 15:58:37 -0400
commit2af0daceb320b59d13e312c6c9b65ae04e7a615b (patch)
tree4d7681fb1a0cea1a5bfa0c76dfbf9a0b7d5a71ec /src/current/dot
parent52c1bb5ebe732582606116342730e76aaaba0c55 (diff)
downloadtame-2af0daceb320b59d13e312c6c9b65ae04e7a615b.tar.gz
tame-2af0daceb320b59d13e312c6c9b65ae04e7a615b.tar.bz2
tame-2af0daceb320b59d13e312c6c9b65ae04e7a615b.zip
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.
Diffstat (limited to 'src/current/dot')
-rw-r--r--src/current/dot/attr-keep.xsl50
-rw-r--r--src/current/dot/defnode.xsl1
2 files changed, 0 insertions, 51 deletions
diff --git a/src/current/dot/attr-keep.xsl b/src/current/dot/attr-keep.xsl
deleted file mode 100644
index d277674..0000000
--- a/src/current/dot/attr-keep.xsl
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
- Styles node based on keep flag
-
- Copyright (C) 2016 LoVullo Associates, Inc.
-
- This file is part of TAME.
-
- TAME is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see
- <http://www.gnu.org/licenses/>.
--->
-<xsl:stylesheet version="2.0"
- xmlns="http://www.w3.org/1999/xhtml"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-
- xmlns:dot="http://www.lovullo.com/calc/dot"
- xmlns:preproc="http://www.lovullo.com/rater/preproc">
-
-
-<!--
- External nodes should be styled as such
--->
-<xsl:template mode="dot:attr-keep" priority="5" match="
- *[ @keep='true' ]
- ">
-
- <dot:attr name="fontcolor">red</dot:attr>
-</xsl:template>
-
-
-
-<!--
- Default node attributes
--->
-<xsl:template match="preproc:sym" mode="dot:defnode-keep" priority="1">
-</xsl:template>
-
-</xsl:stylesheet>
-
diff --git a/src/current/dot/defnode.xsl b/src/current/dot/defnode.xsl
index 1cf6501..6e350df 100644
--- a/src/current/dot/defnode.xsl
+++ b/src/current/dot/defnode.xsl
@@ -92,7 +92,6 @@
<xsl:apply-templates select="." mode="dot:attr-extern" />
<xsl:apply-templates select="." mode="dot:attr-color" />
<xsl:apply-templates select="." mode="dot:attr-shape" />
- <xsl:apply-templates select="." mode="dot:attr-keep" />
</xsl:with-param>
</xsl:call-template>
</xsl:variable>