You are viewing a plain text version of this content. The canonical link for it is here.
Posted to odf-dev@incubator.apache.org by "Svante Schubert (JIRA)" <ji...@apache.org> on 2018/04/11 14:08:00 UTC

[jira] [Commented] (ODFTOOLKIT-473) cache alien element and attribute class to make it faster in OdfXMLFactory

    [ https://issues.apache.org/jira/browse/ODFTOOLKIT-473?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16433958#comment-16433958 ] 

Svante Schubert commented on ODFTOOLKIT-473:
--------------------------------------------

Pretty cool, Fanliwen!

On the road, but I will dive into your patches asap!

Any suggestions in regard to a performance regression test?
There are some large regression test documents in a test subfolder, but no performance test work out-of-the-box, yet.

Thanks for your contribution!

Svante

> cache alien element and attribute class to make it faster in OdfXMLFactory
> --------------------------------------------------------------------------
>
>                 Key: ODFTOOLKIT-473
>                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-473
>             Project: ODF Toolkit
>          Issue Type: Improvement
>          Components: odfdom
>    Affects Versions: 0.6.2-incubating
>            Reporter: fanliwen
>            Assignee: Svante Schubert
>            Priority: Major
>              Labels: performance
>             Fix For: 0.6.2-incubating
>
>         Attachments: alien-performance-jprofiler.png, test-case-after-fix.png, test-case-befor-fix.png
>
>
> Hi,
> Class.forName may not be an efficient method. and in <code>org.odftoolkit.odfdom.pkg{color:#cc7832}.{color}OdfXMLFactory    line:153<code> Class, it use Class.forName to find the Element/Atrribute Class. The <code>classCache</code> map make it better to find the Class. But we need a cache for Alien Element/Atrribute Class too, otherwise it will find the same alien Class by Class.forName again and again. It take too much of CPU cycle.
> It show you in the attachment which a snapshot by JProfiler.It call the Class.forName 39459 times to find the same Class.
> And this is my pull request in GitHub: https://github.com/apache/odftoolkit/pull/3
> Regards.
> ravenq.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)