Closed jochembroekhoff closed 3 years ago
In fact, having done some primitive manual benchmarks (on a single big file) it appeared that the export time scaled exponentially in terms of SLOC.
Thanx! Would be a good idea to look in-depth into the performance issues with union
/make-set
, but for now I'm happy with this improvement.
Performance of default
collect-all
andmake-set
is too bad to be used practically for larger projects. Recently I tried to do an StxLib export of a standard library project, which contained ~180 files, in total consisting of about 26k SLOC. My Statix specification is not too small either, but I would not consider either 'large'.After an hour I killed the project library exporting and started debugging. This led me to discovering that
collect-all
andmake-set
do not appear to scale well. Both useunion
internally which appears to be the main underlying cause.That is why I pass a different union strategy to
collect-all
, overriding the default. This is a dummy union implementation which merely concats the two lists. Concatenating lists is still not too efficient, major optimizations could be done if StrategoArrayLists were to be concatenated as a view (in this particular case, might be suboptimal otherwise).Anyways, this means that the result of
collect-all
is not distinct anymore, so I still pass it through some alternative set creation strategies. These replacemake-set
(which actually wouldn't have been necessary before, becausecollect-all
produces a distinct result). Uses strategies from the relatively new immutable collections API from the standard library.Exporting a StxLib from my project now takes about 35 seconds (instead of 1h+). As far as I am aware, the effective output is the same.