From ce0da76ccf3092466da077aa124526723556d0c0 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 17 Feb 2022 12:30:25 -0500 Subject: [PATCH] Improve symbol table processing time preproc:symtable-process-symbols is run on each pass (e.g. during initial processing and after each template expansion) to introduce new symbols into the symbol table from imports and newly discovered symbols. This processing was previously optimized a bit using maps to reduce the cost of symbol table lookups, but the processing was still inefficient, relying on XSLT1-style processing (as originally written) for deduplication. This now uses `for-each-group` and `perform-sort` to offload the expensive computation onto Saxon, which is much more efficient. Symbol table processing has long been a culprit, but I hadn't attempted to optimize further in recent months because of TAMER work. Since TAMER has been on pause for a few months with other things needing my attention, I needed to provide a short-term performance improvement to keep up with increasing build times. DEV-11716 --- RELEASES.md | 3 + src/current/include/depgen.xsl | 2 +- src/current/include/preproc/symtable.xsl | 131 +++++------------------ 3 files changed, 32 insertions(+), 104 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 9c453eb1..3c2314dd 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -27,6 +27,9 @@ Compiler - `TAMED_RUNTAB_OUT`, if set, will aggregate all runners' runtabs into a single file as jobs are completed. See `tamed --help` for more information and examples. +- Improved symbol table processing performance. + - For packages/maps with thousands of dependenices, this may improve + processing time by a minute or more. Documentation ------------- diff --git a/src/current/include/depgen.xsl b/src/current/include/depgen.xsl index 9db47e00..547b8871 100644 --- a/src/current/include/depgen.xsl +++ b/src/current/include/depgen.xsl @@ -88,7 +88,7 @@