Exponential compile time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
The attached file is very long to compile :
sbcl --dynamic-
(time (load "test-perf"))
This is a long function, but I wonder why the compile time seems
exponential with function length. For example cutting the function
in half makes the compiling much faster (the two parts are
independant, even placed in the same function).
A few elements seem very expensive :
- Removing unwind-protect in the first macro, used only 30 times :
-20% to compile time.
- Removing handler-case from test-error, used 16 times : -40%
(I'm pretty sure that compiling 16 times handler-case does not
cost several seconds in another context).
- Cutting the function in half without removing anything : -55%.
Maybe there is something with combining these elements ? Or they add
much work to the compilation, the compiling being executed in exponential
time ?
----
SBCL 2.0.5
Linux yggdrasil 5.7.7-arch1-1 #1 SMP PREEMPT Wed, 01 Jul 2020 14:53:16 +0000 x86_64 GNU/Linux
This doesn't seem to be exponential time, since cutting it in half reduces the time by 50%. I looked at the test case and didn't see anything out of the ordinary - it's compiling 2,847 lambdas according to TIME which does take some time to do. I'll mark this as invalid. However, some latest changes to HANDLER-BIND have actually cut the amount of consing and time spent in compilation by a bit, if that helps.