diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-17 09:49:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-17 13:27:02 +0200 |
commit | d6bd9c273483b12f1bb2ae398afdba977e3ec336 (patch) | |
tree | 982bc3a3642b7100962d07f806672754c94949d5 /writerfilter | |
parent | d375324a86c5cd4647da5036e846e9c648f97c9c (diff) |
tdf#79878 perf loading docx file, disable SAX threading for writer
since it seems to cost us 20% performance
Change-Id: Ic4796ee3756c8c722feb4851dc48a99e882ba0fe
Reviewed-on: https://gerrit.libreoffice.org/57545
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/ooxml/factoryimpl.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/writerfilter/source/ooxml/factoryimpl.py b/writerfilter/source/ooxml/factoryimpl.py index acbaf4234261..2d54ee8ff6b8 100644 --- a/writerfilter/source/ooxml/factoryimpl.py +++ b/writerfilter/source/ooxml/factoryimpl.py @@ -152,6 +152,11 @@ def getFastParser(): if (!mxFastParser.is()) { mxFastParser = css::xml::sax::FastParser::create(mxContext); + // the threaded parser is about 20% slower loading writer documents + css::uno::Reference< css::lang::XInitialization > xInit( mxFastParser, css::uno::UNO_QUERY_THROW ); + css::uno::Sequence< css::uno::Any > args(1); + args[0] <<= OUString("DisableThreadedParser"); + xInit->initialize(args); """) for url in sorted(ooxUrlAliases.keys()): print(""" mxFastParser->registerNamespace("%s", oox::NMSP_%s);""" % (url, ooxUrlAliases[url])) @@ -167,6 +172,7 @@ def getFastParser(): def createImpl(model): print(""" #include <com/sun/star/xml/sax/FastParser.hpp> +#include <com/sun/star/lang/XInitialization.hpp> #include "ooxml/OOXMLFactory.hxx" #include "ooxml/OOXMLFastHelper.hxx" #include "ooxml/OOXMLStreamImpl.hxx" |