plutext / docx4j

JAXB-based Java library for Word docx, Powerpoint pptx, and Excel xlsx files
https://www.docx4java.org/
2.1k stars 1.2k forks source link

Unnecessary deep-copy of default RPr degrading performance #263

Open shelatgauri opened 7 years ago

shelatgauri commented 7 years ago

When converting a docx to pdf, containg large number of runs, the default RPr is deep-copied using marshalling and unmarshalling multiple times for a single document. To save this time, we can deep-copy the default RPr once and save it in thread local. After each iteration of using RPr element, it can be set to default, using the initial conditions(obtained from default RPr). link to the pull-request created : https://github.com/plutext/docx4j/pull/262

syambrij-pro commented 6 years ago

Updated Conversion.java against commit - https://github.com/syambrij-pro/docx4j/commit/9a4180a66c3d9e1426bb766439241ef26a48b55a

Created another pull request: https://github.com/plutext/docx4j/pull/279

jamding commented 2 years ago

Screen Shot 2022-05-02 at 3 17 56 PM

Why does substituting the XmlUtils#deepCopy line (source) not suffice?