BGap: HUGE ~140x performance improvement at higher alpha' orders
The previous implementation was too naive.
It would load all the terms in the BG recursion at once, and only
then would apply the initial condition phi(A|B) = 0 if A\B != 0 etc.
That is totally fine when the number of terms is not too big (in FORM
standards), as is the case for, say, 8pts up to zeta6 order or 9pts
to zeta5 or so. Since FORM crushes through all the terms, one doesn't
even notice that the whole expansion is far from optimized.
But the situation drastically changes for 9 or 10pts up
to zeta7, as the number of terms during intermediate steps simply
explodes and even FORM has a hard time to handle them.
Of course, given enough time and disk space, the calculations would
eventually finish. But I have no patience when I know things can be better.
The idea of this patch is really simple. It's based on the observation
that the contact terms (given by the regular integrals) do not change
during the recursion since the recursion does not act on the slots of
the integrals. So now the program loads the regular integrals only
during the last step of the recursion, when everything else has already
been done.
Since the recursion is going on with much fewer terms, the performance
gain is HUGE!
For example, now we can compute the following 9pt integral up to
alpha'^7 in 7 seconds (the result contains 205k terms!):
L example = Zint(1,3,4,5,8,2,6,7,9,[p],1,2,3,4,5,6,7,8,9);
#call BGexpand(7)
Time = 3.30 sec Generated terms = 205947
example Terms in output = 205947
Bytes used =
21861416
3.30 sec + 13.55 sec: 16.86 sec out of 6.94 sec
Before this patch:
Time = 135.75 sec Generated terms = 205947
example Terms in output = 205947
Bytes used =
21861416
135.75 sec + 2142.03 sec: 2277.78 sec out of 990.39 sec
A HUGE speedup factor of 142x! (6.9 sec vs 990 sec).
For 10pts at alpha'^7, the speedup is much higher. One
particular integral whose calculation wasn't finished
after more than 5 hours (again, no patience) now takes
around 20 secs.
While this patch improves a lot the calculation at higher
alpha' orders for higher number of points, it slows down
a bit the calculation of more trivial integrals
(like 7pts at zeta4).
This will be addressed in a later patch...