Re[2]: [AWS] Non-lineal parsing time with Templates_parser

Alejandro. R. Mosteo Chagoyen A. R. Mosteo Chagoyen" <alejandro@mosteo.com
Fri, 6 Feb 2004 11:59:14 +0100


Dicho por Jacob Sparre Andersen:
> Alejandro. R. Mosteo Chagoyen wrote:

>> Rows    Time
>> 100     0,138
>> 200     0,399
>> 300     1,651
>> 400     4,33
>> 500     8,275
>> 600     13,564
>> 700     19,509
>> 800     27,501
>> 900     36,278
>> 1000    48,189

>> [...] almost perfectly cuadratic.

>> Someone knows the cause?

> I would guess that it is due to your compiler's
> implementation of Ada.Strings.Unbounded.  With GNAT (the
> versions I have tried) the cost of replacing a slice in an
> Unbounded_String grows roughly linear with the length of the
> string.  This would result in the quadratic growth in the
> total processing time that you observe.

Yes, I forgot, I was using Gnat 3.15p.

My first profiling reports a total time of 2.5 secons, while the real
execution has taken almost 50 seconds. That hints that the hidden time
is in library code as you suggest. However, the Unbounded_String
operators do appear listed in the profile. For example:

1.20%    2.22s     0.03s      ada__strings__unbounded__append$2

so I have no idea of where really this time is going. It may be some
profiler glitch, because your suggestion seems accurate. However, I've
just seen in the AWS 1.4 announcement:

> - Important Templates_Parser speed-up (between x10 and x15) for
> template files containing large vector or matrix tags.

so I'm going to try it right now!

Thanks,

A. Mosteo.