Bill Allombert on Wed, 01 Feb 2012 00:46:43 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

automatic 'return' elimination


Dear PARI developers,

We discovered that the return() function was slow with large input:

? bnf=vector(100,i,vector(200,j,i+j));
? fun0(bnf)=bnf[4];
? fun1(bnf)=return(bnf[4]);
? my(bnf=bnf);for(i=1,10^5,fun0(bnf))
? ##
  ***   last result computed in 264 ms.
? my(bnf=bnf);for(i=1,10^5,fun1(bnf))
? ##
  ***   last result computed in 805 ms.

So as a first step, I have commited a patch (41dd7b6) for the internal GP compiler that
remove 'spurious' returns (like in fun1 above).

Cheers,
Bill.