You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2012/09/17 15:02:07 UTC

[jira] [Created] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Colm O hEigeartaigh created SANTUARIO-346:
---------------------------------------------

             Summary: Create Memory + Performance tests for the stax code
                 Key: SANTUARIO-346
                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
             Project: Santuario
          Issue Type: Task
            Reporter: Colm O hEigeartaigh
            Assignee: Marc Giger
             Fix For: Java 2.0.0



This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.

Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462587#comment-13462587 ] 

Colm O hEigeartaigh commented on SANTUARIO-346:
-----------------------------------------------

Hi Marc,

Great work, thanks! 

So as a summary for the streaming code, memory consumption appears low for encryption + decryption + signature verification cases, but high for signature creation. Should we log a new JIRA to track this?

In terms of time consumption, decryption and signature creation are performing well, but signature verification and encryption are slower than the DOM code. 

>  The memory consumption increases with the document size in the decryption case. This is not expected and for the moment I would say it's a bug.

You mean for the DOM code right? The memory consumption for the StAX is fairly flat for both encryption and decryption. Do you see any areas where the DOM code could be improved in general?

Colm.




                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound.png, encryption-memory-outbound.png, encryption-times-inbound.png, encryption-times-outbound.png, signature-memory-inbound.png, signature-memory-outbound.png, signature-times-inbound.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13465510#comment-13465510 ] 

Colm O hEigeartaigh commented on SANTUARIO-346:
-----------------------------------------------


Ok so we have the following tasks to investigate thus far:

1) Investigate (again) using the TransformSerializer by default. This results in much less memory consumption for DOM decryption.
2) Investigate why DOM signature creation is so much slower than DOM signature verification.
3) Investigate why memory consumption increases with the document size in the decryption case for the StAX code.
4) Investigate the large memory consumption for the signature creation case for the StAX code.

Colm.
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound.png, signature-memory-inbound.png, signature-memory-outbound.png, signature-times-inbound.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marc Giger updated SANTUARIO-346:
---------------------------------

    Attachment: signature-times-outbound-20121025.png
                signature-times-inbound-20121025.png
                signature-memory-outbound-20121025.png
                signature-memory-inbound-20121025.png
                encryption-times-outbound-20121025.png
                encryption-times-inbound-20121025.png
                encryption-memory-outbound-20121025.png
                encryption-memory-inbound-20121025.png

latest performance graphs
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound-20121008.png, encryption-memory-inbound-20121016.png, encryption-memory-inbound-20121025.png, encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound-20121008.png, encryption-memory-outbound-20121016.png, encryption-memory-outbound-20121025.png, encryption-memory-outbound.png, encryption-times-inbound-20121008.png, encryption-times-inbound-20121016.png, encryption-times-inbound-20121025.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound-20121008.png, encryption-times-outbound-20121016.png, encryption-times-outbound-20121025.png, encryption-times-outbound.png, signature-memory-inbound-20121008.png, signature-memory-inbound-20121016.png, signature-memory-inbound-20121025.png, signature-memory-inbound.png, signature-memory-outbound-20121008.png, signature-memory-outbound-20121016.png, signature-memory-outbound-20121025.png, signature-memory-outbound.png, signature-times-inbound-20121008.png, signature-times-inbound-20121011.png, signature-times-inbound-20121016.png, signature-times-inbound-20121025.png, signature-times-inbound.png, signature-times-outbound-20121008.png, signature-times-outbound-20121016.png, signature-times-outbound-20121025.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462971#comment-13462971 ] 

Marc Giger commented on SANTUARIO-346:
--------------------------------------

Hi Colm,

> So as a summary for the streaming code, memory consumption appears low for encryption + decryption + signature
> verification cases, but high for signature creation. Should we log a new JIRA to track this?

Yes, if you like. We could also update this issue with news regarding to the performance... Your choice.

> You mean for the DOM code right? The memory consumption for the StAX is fairly flat for both encryption and
> decryption. 

No I really meant the stax code. It's not flat enough:-) The memory consumption should stay at the same low level independent of the document size. At the moment I don't see any reason why it should increase...

> Do you see any areas where the DOM code could be improved in general?

No, of course not;-) Joke aside, regarding to its memory performance I don't see much room for improvement. DOM just needs a lot of memory. Just prevent to hold the whole DOM tree multiple times in memory (can happen e.g. during decryption when a DocumentFragment is built. Have a look at the difference between encryption and decryption.). What me wonders is why the signature creation is that much slower than signature verification.

I will have a look at the performance issues for stax and dom as soon as possible. Perhaps I will involve Woodstox people to get some more ideas. Do you know someone of them?
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound.png, encryption-memory-outbound.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound.png, signature-memory-inbound.png, signature-memory-outbound.png, signature-times-inbound.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470953#comment-13470953 ] 

Marc Giger commented on SANTUARIO-346:
--------------------------------------

The memory consumption during signature creation is now on the expected level. Fixed in r1394970.
This update also improves the overall processing times a little bit.
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound.png, signature-memory-inbound.png, signature-memory-outbound.png, signature-times-inbound.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479899#comment-13479899 ] 

Colm O hEigeartaigh commented on SANTUARIO-346:
-----------------------------------------------


Hi Marc,

> So my question is now: Why is xalan marked as provided and optional when santuario only works 100% correctly with it? There are also 
> hardcoded references to it. So its not just a compile dependency but also a runtime requirement.

It's provided + optional as it's only required for the XPath "here()" function defined in the XML Signature specification. I could not find a way of implementing that function without Xalan (which itself requires some hacking to get it to work). It seems unnecessary for Santuario to mandate Xalan + xerces + xml-apis just to support a function which is probably not required by 99% of users.

Thanks for your analysis - I will switch to using the TransformSerializer by default.

Colm.
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound-20121008.png, encryption-memory-inbound-20121016.png, encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound-20121008.png, encryption-memory-outbound-20121016.png, encryption-memory-outbound.png, encryption-times-inbound-20121008.png, encryption-times-inbound-20121016.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound-20121008.png, encryption-times-outbound-20121016.png, encryption-times-outbound.png, signature-memory-inbound-20121008.png, signature-memory-inbound-20121016.png, signature-memory-inbound.png, signature-memory-outbound-20121008.png, signature-memory-outbound-20121016.png, signature-memory-outbound.png, signature-times-inbound-20121008.png, signature-times-inbound-20121011.png, signature-times-inbound-20121016.png, signature-times-inbound.png, signature-times-outbound-20121008.png, signature-times-outbound-20121016.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13477040#comment-13477040 ] 

Marc Giger commented on SANTUARIO-346:
--------------------------------------

2) Investigate why DOM signature creation is so much slower than DOM signature verification.

Solved in rr1398806. Replaced the sloooooooooow^2 xerces identity-transformer with XMLUtils.outputDOM() in the testcases. 

3) Investigate why memory consumption increases with the document size in the decryption case for the StAX code.

Solved in r1395721.

4) Investigate the large memory consumption for the signature creation case for the StAX code.

Solved in r1394970.

So just 

1) Investigate (again) using the TransformSerializer by default. This results in much less memory consumption for DOM decryption. 

has to be solved. 
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound-20121008.png, encryption-memory-inbound-20121016.png, encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound-20121008.png, encryption-memory-outbound-20121016.png, encryption-memory-outbound.png, encryption-times-inbound-20121008.png, encryption-times-inbound-20121016.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound-20121008.png, encryption-times-outbound-20121016.png, encryption-times-outbound.png, signature-memory-inbound-20121008.png, signature-memory-inbound-20121016.png, signature-memory-inbound.png, signature-memory-outbound-20121008.png, signature-memory-outbound-20121016.png, signature-memory-outbound.png, signature-times-inbound-20121008.png, signature-times-inbound-20121011.png, signature-times-inbound-20121016.png, signature-times-inbound.png, signature-times-outbound-20121008.png, signature-times-outbound-20121016.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463813#comment-13463813 ] 

Marc Giger commented on SANTUARIO-346:
--------------------------------------

Hi Colm,

> Take a look at the attached graph which uses the TransformSerializer instead of the default DocumentSerializer. Memory consumption is much better, around 190MB less for
> the maximum case compared to the default DocumentSerializer.

Nice. Good idea!

> The problem with the TransformSerializer irrc is that there were problems when it was not used with Xalan. It might be worth exploring this further for the 2.0 release to see if
> we could switch to using it by default. 

Do you mean there are problems if the jdk provided xalan is in use?

Marc
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound.png, signature-memory-inbound.png, signature-memory-outbound.png, signature-times-inbound.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marc Giger updated SANTUARIO-346:
---------------------------------

    Attachment: encryption-memory-inbound-20121016.png
                encryption-memory-outbound-20121016.png
                encryption-times-inbound-20121016.png
                encryption-times-outbound-20121016.png
                signature-memory-inbound-20121016.png
                signature-memory-outbound-20121016.png
                signature-times-inbound-20121016.png
                signature-times-outbound-20121016.png

"Last" ;-) performance update in r1398806.
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound-20121008.png, encryption-memory-inbound-20121016.png, encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound-20121008.png, encryption-memory-outbound-20121016.png, encryption-memory-outbound.png, encryption-times-inbound-20121008.png, encryption-times-inbound-20121016.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound-20121008.png, encryption-times-outbound-20121016.png, encryption-times-outbound.png, signature-memory-inbound-20121008.png, signature-memory-inbound-20121016.png, signature-memory-inbound.png, signature-memory-outbound-20121008.png, signature-memory-outbound-20121016.png, signature-memory-outbound.png, signature-times-inbound-20121008.png, signature-times-inbound-20121011.png, signature-times-inbound-20121016.png, signature-times-inbound.png, signature-times-outbound-20121008.png, signature-times-outbound-20121016.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13461954#comment-13461954 ] 

Marc Giger commented on SANTUARIO-346:
--------------------------------------

To be able to explain the graphs in detail I need some time to analyze the results.

Still some notes:

- Just because we are streaming doesn't mean it _must_ be faster per se. Santuario seems to do an excellent job regarding to it's "time" performance.
- The XmlReaderToWriter.writeAll(xmlStreamReader, xmlStreamWriter); used for testing the outbound performance seems not to be the most efficient way. (It's always one of the top entries during profiling) Expect a little bit better performance under real conditions.
- I'm sure there is still a lot of room for improvements. I already have some ideas in the pipeline.
- The peaks on the graphs are explainable by the GC.
- The memory consumption increases with the document size in the decryption case. This is not expected and for the moment I would say it's a bug.
- The memory consumption for the signature creation case makes me nervous. It's expected that it needs a lot of memory but not that much. Bug?

The measurement was made with fully signed resp. encrypted documents. The numbers will most probably differ with partial signed / encrypted documents.

I think the xmlsec processing could be done faster with a better StAX API (not proved). A lot of code (All XMLSecEvent classes, code in the XMLSecStreamReader, code in the XMLSecEventReader) could be
left away if we had direct access to the current namespace scope. I've never understood why it isn't exposed. As far as I understand, StAX Parsers have to manage it anyway... Btw, CXF has the same problem and solved it via reflection.

That's it for the moment.
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound.png, encryption-memory-outbound.png, encryption-times-inbound.png, encryption-times-outbound.png, signature-memory-inbound.png, signature-memory-outbound.png, signature-times-inbound.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh updated SANTUARIO-346:
------------------------------------------

    Attachment: encryption-memory-inbound-transformer.png

Hi Marc,

> Just prevent to hold the whole DOM tree multiple times in 
> memory (can happen e.g. during decryption when a 
> DocumentFragment is built. Have a look at the difference 
> between encryption and decryption.). 

Take a look at the attached graph which uses the TransformSerializer instead of the default DocumentSerializer. Memory consumption is much better, around 190MB less for the maximum case compared to the default DocumentSerializer.

The problem with the TransformSerializer irrc is that there were problems when it was not used with Xalan. It might be worth exploring this further for the 2.0 release to see if we could switch to using it by default.

Colm.
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound.png, signature-memory-inbound.png, signature-memory-outbound.png, signature-times-inbound.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13467972#comment-13467972 ] 

Marc Giger commented on SANTUARIO-346:
--------------------------------------

Minor performance update in r1393096
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound.png, signature-memory-inbound.png, signature-memory-outbound.png, signature-times-inbound.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479232#comment-13479232 ] 

Marc Giger commented on SANTUARIO-346:
--------------------------------------

Colm,

I did some tests with the TransformSerializer.
Encryption tests passes under the following conditions:

ORA JDK 1.7.0.7 with Xalan 2.7.1
ORA JDK 1.7.0.7 with SAXON 9.4
ORA JDK 1.7.0.7 with built-in Xalan
ORA JDK 1.6.0.35 with Xalan 2.7.1
ORA JDK 1.6.0.35 with built-in Xalan
ORA JDK 1.6.0.35 with SAXON 9.4

IBM JDK 1.6.0.8 with SAXON 9.4 (some tests are in error because of unsupported crypto-algo's)
IBM JDK 1.6.0.8 with built-in Xalan (a lot of failures)
IBM JDK 1.6.0.8 with Xalan 2.7.1 (some tests are in error because of unsupported crypto-algo's)
Oracle XDM: Tests run: 736, Failures: 5, Errors: 430, Skipped: 12 ;-)

Everything seems to working fine with SAXON but two C14N tests are failing because of a wrong assumption in
the C14N code:
Failed tests:   test223excl(org.apache.xml.security.test.dom.c14n.implementations.Canonicalizer20010315ExclusiveTest): expected:<[<p abc="xy&quot;z" style="indented">
  test33subset(org.apache.xml.security.test.dom.c14n.implementations.Canonicalizer20010315Test): expected:<...elem4"></e4>

The Ora-jdk built-in Xalan has a problem with the XPath tests.

So my question is now: Why is xalan marked as provided and optional when santuario only works 100% correctly with it? There are also hardcoded references to it. So its not just a compile dependency but also a runtime requirement.

Other from that I would say we should switch to the TransformSerializer for encryption since I saw all kind of exceptions but not a single one which has its origin by the TransformSerializer code.
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound-20121008.png, encryption-memory-inbound-20121016.png, encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound-20121008.png, encryption-memory-outbound-20121016.png, encryption-memory-outbound.png, encryption-times-inbound-20121008.png, encryption-times-inbound-20121016.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound-20121008.png, encryption-times-outbound-20121016.png, encryption-times-outbound.png, signature-memory-inbound-20121008.png, signature-memory-inbound-20121016.png, signature-memory-inbound.png, signature-memory-outbound-20121008.png, signature-memory-outbound-20121016.png, signature-memory-outbound.png, signature-times-inbound-20121008.png, signature-times-inbound-20121011.png, signature-times-inbound-20121016.png, signature-times-inbound.png, signature-times-outbound-20121008.png, signature-times-outbound-20121016.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13479925#comment-13479925 ] 

Colm O hEigeartaigh commented on SANTUARIO-346:
-----------------------------------------------


Ok I've switched to using the TransformSerializer. Could you run the benchmarks again?

Colm.
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound-20121008.png, encryption-memory-inbound-20121016.png, encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound-20121008.png, encryption-memory-outbound-20121016.png, encryption-memory-outbound.png, encryption-times-inbound-20121008.png, encryption-times-inbound-20121016.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound-20121008.png, encryption-times-outbound-20121016.png, encryption-times-outbound.png, signature-memory-inbound-20121008.png, signature-memory-inbound-20121016.png, signature-memory-inbound.png, signature-memory-outbound-20121008.png, signature-memory-outbound-20121016.png, signature-memory-outbound.png, signature-times-inbound-20121008.png, signature-times-inbound-20121011.png, signature-times-inbound-20121016.png, signature-times-inbound.png, signature-times-outbound-20121008.png, signature-times-outbound-20121016.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13474312#comment-13474312 ] 

Marc Giger commented on SANTUARIO-346:
--------------------------------------

r1397150 fixes a bug in the dom-signature-creation code. Interestingly it doesn't have much influence. 
1397151 is a performance update in the stax code. Signature verification is now a little bit faster with StAX. @see latest graph.
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound-20121008.png, encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound-20121008.png, encryption-memory-outbound.png, encryption-times-inbound-20121008.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound-20121008.png, encryption-times-outbound.png, signature-memory-inbound-20121008.png, signature-memory-inbound.png, signature-memory-outbound-20121008.png, signature-memory-outbound.png, signature-times-inbound-20121008.png, signature-times-inbound-20121011.png, signature-times-inbound.png, signature-times-outbound-20121008.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marc Giger updated SANTUARIO-346:
---------------------------------

    Attachment: signature-times-inbound-20121011.png
    
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound-20121008.png, encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound-20121008.png, encryption-memory-outbound.png, encryption-times-inbound-20121008.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound-20121008.png, encryption-times-outbound.png, signature-memory-inbound-20121008.png, signature-memory-inbound.png, signature-memory-outbound-20121008.png, signature-memory-outbound.png, signature-times-inbound-20121008.png, signature-times-inbound-20121011.png, signature-times-inbound.png, signature-times-outbound-20121008.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Colm O hEigeartaigh updated SANTUARIO-346:
------------------------------------------

    Attachment: encryption-times-inbound-colm.png

Hi Marc,

One further point. I ran the tests myself and get pretty much the same results that you have reported, exception for decryption performance. I am consistently getting poor performance for the StAX code compared to the DOM code (see attached).

Colm.
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound.png, encryption-memory-outbound.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound.png, signature-memory-inbound.png, signature-memory-outbound.png, signature-times-inbound.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marc Giger updated SANTUARIO-346:
---------------------------------

    Attachment: signature-times-outbound.png
                signature-times-inbound.png
                signature-memory-outbound.png
                signature-memory-inbound.png
                encryption-times-outbound.png
                encryption-times-inbound.png
                encryption-memory-outbound.png
                encryption-memory-inbound.png
    
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound.png, encryption-memory-outbound.png, encryption-times-inbound.png, encryption-times-outbound.png, signature-memory-inbound.png, signature-memory-outbound.png, signature-times-inbound.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marc Giger updated SANTUARIO-346:
---------------------------------

    Attachment: signature-times-outbound-20121008.png
                signature-times-inbound-20121008.png
                signature-memory-outbound-20121008.png
                signature-memory-inbound-20121008.png
                encryption-times-outbound-20121008.png
                encryption-times-inbound-20121008.png
                encryption-memory-outbound-20121008.png
                encryption-memory-inbound-20121008.png

Actual performance of the trunk-code. At the moment I have no more ideas how to improve the StAX performance with the current StAX API...
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound-20121008.png, encryption-memory-inbound.png, encryption-memory-inbound-transformer.png, encryption-memory-outbound-20121008.png, encryption-memory-outbound.png, encryption-times-inbound-20121008.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound-20121008.png, encryption-times-outbound.png, signature-memory-inbound-20121008.png, signature-memory-inbound.png, signature-memory-outbound-20121008.png, signature-memory-outbound.png, signature-times-inbound-20121008.png, signature-times-inbound.png, signature-times-outbound-20121008.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (SANTUARIO-346) Create Memory + Performance tests for the stax code

Posted by "Marc Giger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SANTUARIO-346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462991#comment-13462991 ] 

Marc Giger commented on SANTUARIO-346:
--------------------------------------

> One further point. I ran the tests myself and get pretty much the same results that you have reported, exception for
> decryption performance. I am consistently getting poor performance for the StAX code compared to the DOM code
> (see attached).

It's very likely the active cpu-frequency-scaling.
1. It just happens in the decryption case (Keyword Thread)
2. The curve is not linear but with a lot of non deterministic peaks.

Both points are an indication for active cpu-freq-scaling. I have to play around with all of the different scaling governors on Linux to give people a good advice. For Windows, I have no idea...
                
> Create Memory + Performance tests for the stax code
> ---------------------------------------------------
>
>                 Key: SANTUARIO-346
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-346
>             Project: Santuario
>          Issue Type: Task
>            Reporter: Colm O hEigeartaigh
>            Assignee: Marc Giger
>             Fix For: Java 2.0.0
>
>         Attachments: encryption-memory-inbound.png, encryption-memory-outbound.png, encryption-times-inbound-colm.png, encryption-times-inbound.png, encryption-times-outbound.png, signature-memory-inbound.png, signature-memory-outbound.png, signature-times-inbound.png, signature-times-outbound.png
>
>
> This task is to create memory and performance tests for the streaming code analogous to the tests in WSS4J. We can add testng as a dependency for these tests if it makes it easier. The end result should be some data that we can use to publicize the new implementation etc.
> Colm.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira