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 2017/03/05 12:03:32 UTC
[jira] [Closed] (ODFTOOLKIT-426) PERFORMANCE: simple
Document.getCopyStyleList improvements to reduce String allocation,
hashing, etc.
[ https://issues.apache.org/jira/browse/ODFTOOLKIT-426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Svante Schubert closed ODFTOOLKIT-426.
--------------------------------------
Resolution: Fixed
closing issue for upcoming release
> PERFORMANCE: simple Document.getCopyStyleList improvements to reduce String allocation, hashing, etc.
> -----------------------------------------------------------------------------------------------------
>
> Key: ODFTOOLKIT-426
> URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-426
> Project: ODF Toolkit
> Issue Type: Improvement
> Components: simple api
> Environment: 0.8.2-incubating-SNAPSHOT, jdk1.8.0_77, win7
> Reporter: Nimarukan
> Assignee: Svante Schubert
> Priority: Minor
> Labels: patch, performance
> Fix For: 0.6.2-incubating
>
> Attachments: Issue-426-patches.zip, result-ods-xml-before-vs-after-patches_diff.zip
>
>
> org.odftoolkit.simple
> Document.getCopyStyleList
> is a top hotspot in a (NetBeans) sampled profiling run of test_1 of
> https://issues.apache.org/jira/secure/attachment/12795379/odftoolkit-performance-test.zip
> When a sheet is copied from one document to another, simple.Document also merges metadata such as styles. For each style it iterates over every cell with that style. The current code can be improved by reusing constructed strings (also reducing garbage collection), removing unnecessary hash table lookups, etc.
> After these changes, Document.getCopyStyleList takes about 1/16th the original time in the profiled run.
> (This is surprising. Maybe it enables some optimizations that eliminate String creation in an inner loop in common cases.)
> (The gain is not due to an error of omission: The template.ods source file used in this performance test is a spreadsheet with styled cells. The differences between the ods xml files of the result spreadsheet produced before these patches are applied, and the ods xml files of the result spreadsheet produced after these patches are applied, are only in times and in random strings appended to style names. So these changes did not significantly change the result spreadsheet.)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)