From 959ff065395ca62fa5de1ea849ccf2a356237845 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 19 Oct 2023 10:59:30 -0400 Subject: [PATCH] depgen (preproc:symtable): Use for-each-group for deduplication And here's the optimization that I had wanted to perform all along, but it took some time to confidently get to this point. `preceding-sibling` was used since the XSLT1 days for deduplication, before `for-each-group` existed. It works just fine for small inputs, but the problem is we're doing this many thousands of times in larger packages, and that really adds up. (In this case, shaving ~8s off of one of our large packages with ~20k symbols in play.) DEV-15114 --- src/current/include/depgen.xsl | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/current/include/depgen.xsl b/src/current/include/depgen.xsl index 0eecc5cd..d728a119 100644 --- a/src/current/include/depgen.xsl +++ b/src/current/include/depgen.xsl @@ -107,41 +107,31 @@ - - - - - - - - + + + + + - + - - - @@ -181,7 +171,7 @@ number( $sym/@dim ), position() )" /> - +