Complexity for displaying decimal values does not seem very good (from gforge #17642)
Imported issue: Initially reported by @chevilla in https://gforge.inria.fr/tracker/?group_id=1015&aid=17642
For the record, here is some notes I took once on the comparison of speed between binary and decimal display of values.
Let us consider the following script that produces a file named timings.txt, listing the time required to display some value in binary and decimal for various precisions.
> prec = 20;
> bashexecute("rm -rf timings.txt && touch timings.txt");
> while prec < 30000 do {
val=exp(1);
display=binary;
a=time(val);
display=decimal;
b=time(val);
print(prec,"\t",a,"\t",b) >> "timings.txt";
prec = nearestint(prec*105/100);
};
On my computer, I currently (git #38073954) obtain something that, when plotted with gnuplot, suggests that the time for displaying in decimal mode a value of precision p is roughly p^2.46 / 4e10 while the time for displaying the same value in binary mode is roughly p^1.6 / 2e8.
I used the following gnuplot command line:
plot "timings.txt" using 1:2 with lines, "timings.txt" using 1:3 with lines, x**2.46/4e10 with lines, x**1.6/2e8 with lines
I know that displaying values in decimal is more complicated because we wish to display the minimal number of digits that enable one to recover the true value. And I agree that optimizing this is not a major issue, but this report is just to remember that we might have something to optimize here.