You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Nicola Ken Barozzi <ni...@apache.org> on 2003/03/28 17:50:42 UTC

[HEADS UP] Cocoon CLI performance up 50%!

First of all a big thanks to Upayavira for listening to my ramblings on 
optimization strategies and creating well done concrete implementation 
of them with excellent additional ideas.

Since he was not satisfied, he has also converted the CLI to 
commons-cli, added a CLI config file (cli.xconf), and created the Cocoon 
bean.

Hey, do we have a new Cocooner here? :-)

                           - o -

Now for the actual figures.

The 'original' run is done by taking Cocoon-2.1 CVS and doing build 
docs. The numbers are taken from the CLI run-time figure, not the Ant one.

To try the 'optimized' one, edit cli.xconf by changing 
confirm-extensions="true" to false. What does this entail? That all 
files without extensions are outputted as-is, without appending a proper 
extension. In sites that always use explicit extension, it makes no 
difference.

              +---------------+---------------+----------+
              |   original    |   optimized   |  diff    |
              +---------------+---------------+----------+
              |               |               |          |
   memory     |     65 Mb     |    40 Mb      |  *-30%*  |
   time       |     51 sec    |    103 sec    |  *-51%*  |
              |               |               |          |
              +---------------+---------------+----------+


These figures are in line with what was estimated before venturing on 
this path, so it figures.

This amount though gets lower if PDFs are involved as in Forrest, 
because their links are the same of the respective pages, so they just 
add an overhead that is the same in both cases, ruining the % advantage.

51 seconds. A record.

And BTW it also makes links not have .html appended if mime-type is not 
recognized, as asked by many Forrest users.

Someone wants to try it on Forrest and see the speed increase? ;-)

We need though to make the Forrest sitemap much faster, because it's 
*terribly* (5x) slower. With these two enhancements, it can finally 
start to please more users with speed :-)

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Geoff Howard wrote, On 28/03/2003 18.53:
> At 12:47 PM 3/28/2003, Nicola Ken wrote:
> 
>> Geoff Howard wrote, On 28/03/2003 18.13:
>>
>>> At 12:05 PM 3/28/2003, you wrote:
>>>
>>>> Berin Loritsch wrote, On 28/03/2003 17.58:
>>>>
>>>>> Nicola Ken Barozzi wrote:
>>>>>
>>>>>>
>>>>>>              +---------------+---------------+----------+
>>>>>>              |   original    |   optimized   |  diff    |
>>>>>>              +---------------+---------------+----------+
>>>>>>              |               |               |          |
>>>>>>   memory     |     65 Mb     |    40 Mb      |  *-30%*  |
>>>>>>   time       |     51 sec    |    103 sec    |  *-51%*  |
>>>>>>              |               |               |          |
>>>>>>              +---------------+---------------+----------+
>>>>>
>>>>>
>>>>>
>>>>> Umm, is the original supposed to be 65MB/103 sec ?
>>>>
>>>>
>>>>
>>>> Oops! 8-)
>>>
>>>
>>> And while we're at it, isn't that more like a 38/39% improvement in 
>>> memory?
>>
>>
>> It depends on what you calculate it.
>>
>> 20 is 30% of 65.
> 
> 
> but 40Mb is 25Mb less than 65Mb...
> 
> ;-)

DOH!

:-))))))


Me needs sleeeeeep ;-))

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Geoff Howard <co...@leverageweb.com>.
At 12:47 PM 3/28/2003, Nicola Ken wrote:

>Geoff Howard wrote, On 28/03/2003 18.13:
>>At 12:05 PM 3/28/2003, you wrote:
>>
>>>Berin Loritsch wrote, On 28/03/2003 17.58:
>>>
>>>>Nicola Ken Barozzi wrote:
>>>>
>>>>>
>>>>>              +---------------+---------------+----------+
>>>>>              |   original    |   optimized   |  diff    |
>>>>>              +---------------+---------------+----------+
>>>>>              |               |               |          |
>>>>>   memory     |     65 Mb     |    40 Mb      |  *-30%*  |
>>>>>   time       |     51 sec    |    103 sec    |  *-51%*  |
>>>>>              |               |               |          |
>>>>>              +---------------+---------------+----------+
>>>>
>>>>
>>>>Umm, is the original supposed to be 65MB/103 sec ?
>>>
>>>
>>>Oops! 8-)
>>
>>And while we're at it, isn't that more like a 38/39% improvement in memory?
>
>It depends on what you calculate it.
>
>20 is 30% of 65.

but 40Mb is 25Mb less than 65Mb...

;-)

Geoff 


Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Geoff Howard wrote, On 28/03/2003 18.13:
> At 12:05 PM 3/28/2003, you wrote:
> 
> 
>> Berin Loritsch wrote, On 28/03/2003 17.58:
>>
>>> Nicola Ken Barozzi wrote:
>>>
>>>>
>>>>              +---------------+---------------+----------+
>>>>              |   original    |   optimized   |  diff    |
>>>>              +---------------+---------------+----------+
>>>>              |               |               |          |
>>>>   memory     |     65 Mb     |    40 Mb      |  *-30%*  |
>>>>   time       |     51 sec    |    103 sec    |  *-51%*  |
>>>>              |               |               |          |
>>>>              +---------------+---------------+----------+
>>>
>>>
>>> Umm, is the original supposed to be 65MB/103 sec ?
>>
>>
>> Oops! 8-)
> 
> 
> And while we're at it, isn't that more like a 38/39% improvement in memory?

It depends on what you calculate it.

20 is 30% of 65.

65*30/100~=20

So it uses 30% less memory of the original one.
But yes, the original one uses 38/39% more memory than the fast one.

It's always the same thing: if A is 33% less than B (one third less), 
then B is 50% more than A (double more)  ;-)


Anyway, it's much faster, ok? ;-P

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Geoff Howard <co...@leverageweb.com>.
At 12:05 PM 3/28/2003, you wrote:


>Berin Loritsch wrote, On 28/03/2003 17.58:
>>Nicola Ken Barozzi wrote:
>>
>>>
>>>              +---------------+---------------+----------+
>>>              |   original    |   optimized   |  diff    |
>>>              +---------------+---------------+----------+
>>>              |               |               |          |
>>>   memory     |     65 Mb     |    40 Mb      |  *-30%*  |
>>>   time       |     51 sec    |    103 sec    |  *-51%*  |
>>>              |               |               |          |
>>>              +---------------+---------------+----------+
>>
>>Umm, is the original supposed to be 65MB/103 sec ?
>
>Oops! 8-)

And while we're at it, isn't that more like a 38/39% improvement in memory?

Geoff


Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Pier Fumagalli <pi...@betaversion.org>.
"Nicola Ken Barozzi" <ni...@apache.org> wrote:
> Berin Loritsch wrote, On 28/03/2003 17.58:
> 
>              +---------------+---------------+----------+
>              |   original    |   optimized   |  diff    |
>              +---------------+---------------+----------+
>              |               |               |          |
>   memory     |     65 Mb     |    40 Mb      |  *-30%*  |
>   time       |     103 sec   |    51 sec     |  *-51%*  |
>              |               |               |          |
>              +---------------+---------------+----------+
> 
>> Anyway, great job!

+1 :-)

    Pier


Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Pier Fumagalli <pi...@betaversion.org>.
"Nicola Ken Barozzi" <ni...@apache.org> wrote:
> Berin Loritsch wrote, On 28/03/2003 17.58:
> 
>              +---------------+---------------+----------+
>              |   original    |   optimized   |  diff    |
>              +---------------+---------------+----------+
>              |               |               |          |
>   memory     |     65 Mb     |    40 Mb      |  *-30%*  |
>   time       |     103 sec   |    51 sec     |  *-51%*  |
>              |               |               |          |
>              +---------------+---------------+----------+
> 
>> Anyway, great job!

+1 :-)

    Pier


Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Nicola Ken Barozzi <ni...@apache.org>.

Berin Loritsch wrote, On 28/03/2003 17.58:
> Nicola Ken Barozzi wrote:
> 
>>
>>              +---------------+---------------+----------+
>>              |   original    |   optimized   |  diff    |
>>              +---------------+---------------+----------+
>>              |               |               |          |
>>   memory     |     65 Mb     |    40 Mb      |  *-30%*  |
>>   time       |     51 sec    |    103 sec    |  *-51%*  |
>>              |               |               |          |
>>              +---------------+---------------+----------+
> 
> 
> Umm, is the original supposed to be 65MB/103 sec ?

Oops! 8-)


               +---------------+---------------+----------+
               |   original    |   optimized   |  diff    |
               +---------------+---------------+----------+
               |               |               |          |
    memory     |     65 Mb     |    40 Mb      |  *-30%*  |
    time       |     103 sec   |    51 sec     |  *-51%*  |
               |               |               |          |
               +---------------+---------------+----------+


> Anyway, great job!



-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Nicola Ken Barozzi <ni...@apache.org>.

Berin Loritsch wrote, On 28/03/2003 17.58:
> Nicola Ken Barozzi wrote:
> 
>>
>>              +---------------+---------------+----------+
>>              |   original    |   optimized   |  diff    |
>>              +---------------+---------------+----------+
>>              |               |               |          |
>>   memory     |     65 Mb     |    40 Mb      |  *-30%*  |
>>   time       |     51 sec    |    103 sec    |  *-51%*  |
>>              |               |               |          |
>>              +---------------+---------------+----------+
> 
> 
> Umm, is the original supposed to be 65MB/103 sec ?

Oops! 8-)


               +---------------+---------------+----------+
               |   original    |   optimized   |  diff    |
               +---------------+---------------+----------+
               |               |               |          |
    memory     |     65 Mb     |    40 Mb      |  *-30%*  |
    time       |     103 sec   |    51 sec     |  *-51%*  |
               |               |               |          |
               +---------------+---------------+----------+


> Anyway, great job!



-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Berin Loritsch <bl...@apache.org>.
Nicola Ken Barozzi wrote:
> 
>              +---------------+---------------+----------+
>              |   original    |   optimized   |  diff    |
>              +---------------+---------------+----------+
>              |               |               |          |
>   memory     |     65 Mb     |    40 Mb      |  *-30%*  |
>   time       |     51 sec    |    103 sec    |  *-51%*  |
>              |               |               |          |
>              +---------------+---------------+----------+

Umm, is the original supposed to be 65MB/103 sec ?

Anyway, great job!


Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Berin Loritsch <bl...@apache.org>.
Nicola Ken Barozzi wrote:
> 
>              +---------------+---------------+----------+
>              |   original    |   optimized   |  diff    |
>              +---------------+---------------+----------+
>              |               |               |          |
>   memory     |     65 Mb     |    40 Mb      |  *-30%*  |
>   time       |     51 sec    |    103 sec    |  *-51%*  |
>              |               |               |          |
>              +---------------+---------------+----------+

Umm, is the original supposed to be 65MB/103 sec ?

Anyway, great job!


Cocoon brokenness (Re: [HEADS UP] Cocoon CLI performance up 50%!)

Posted by Jeff Turner <je...@apache.org>.
On Fri, Mar 28, 2003 at 05:50:42PM +0100, Nicola Ken Barozzi wrote:
...
> Someone wants to try it on Forrest and see the speed increase? ;-)

That first requires upgrading the Cocoon jars, and Cocoon is broken again.

1) I have a test pipeline:

<map:match pattern="test">
  <map:generate src="cocoon:/community/howto/xmlform/howto-xmlform.xml"/>
  <map:transform type="linkrewriter" src="cocoon:/linkmap"/>
  <map:serialize type="xml"/>
</map:match>

Cocoon reports:

DEBUG   (2003-03-29) 23:36.01:561   [core.modules.xml] (/forrest/test)
Thread-49/XMLFileModule: Error using source cocoon:/linkmap
Could not get sitemap source cocoon://linkmap
org.apache.cocoon.ResourceNotFoundException: No pipeline matched request: linkmap

2) I change the generator to read a regular file (not cocoon:..):

<map:match pattern="test">
  <map:generate src="test.xml"/>
  <map:transform type="linkrewriter" src="cocoon:/linkmap"/>
  <map:serialize type="xml"/>
</map:match>

Link rewriting works.

3) I change the generator back to the cocoon: URL (pipeline in 1), and link
rewriting now works :|  Something very weird going on.


--Jeff

Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Nicola Ken Barozzi <ni...@apache.org>.

Sylvain Wallez wrote, On 28/03/2003 19.19:
> Nicola Ken Barozzi wrote:
...
>> To try the 'optimized' one, edit cli.xconf by changing 
>> confirm-extensions="true" to false. What does this entail? That all 
>> files without extensions are outputted as-is, without appending a 
>> proper extension. In sites that always use explicit extension, it 
>> makes no difference. 
> 
> 
> Can you explain what's the purpose of "confirm-extensions" ?

Example:

in the webapp:

   http://localhost:8080/cocoon/welcome

in CLI standard:

   docs/welcome.html

in optimized CLI:

   docs/welcome

It does not attempt to encode the Mime-type in the filename when 
extensions are not present. So if you don't have files without 
extensions, nothing changes. If you do, the browser does not get the 
mime-type (it's a file system), and usually does not display it as html.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: [HEADS UP] Cocoon CLI performance up 50%!

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Nicola Ken Barozzi wrote:

>
> First of all a big thanks to Upayavira for listening to my ramblings 
> on optimization strategies and creating well done concrete 
> implementation of them with excellent additional ideas.
>
> Since he was not satisfied, he has also converted the CLI to 
> commons-cli, added a CLI config file (cli.xconf), and created the 
> Cocoon bean.
>
> Hey, do we have a new Cocooner here? :-)
>
>                           - o -
>
> Now for the actual figures.
>
> The 'original' run is done by taking Cocoon-2.1 CVS and doing build 
> docs. The numbers are taken from the CLI run-time figure, not the Ant 
> one.
>
> To try the 'optimized' one, edit cli.xconf by changing 
> confirm-extensions="true" to false. What does this entail? That all 
> files without extensions are outputted as-is, without appending a 
> proper extension. In sites that always use explicit extension, it 
> makes no difference. 


Can you explain what's the purpose of "confirm-extensions" ?

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }