FastSerializer: Also use cache for writing to ForMerge if we are inside mark()

Desktop / LibreOffice - Matúš Kukan [collabora.com] - 23 October 2014 07:30 UTC

To ensure the correct order of calling ForMerge methods, call flush always before touching maMarkStack.

This was the missing piece in optimizing write() methods, because of writeBytes() checking each time what to call. E.g. for Calc documents we don't use maMarkStack at all. So, just transfer the output to proper "ForMerge" when inside mark() and allow optimizations. This commit makes write() methods almost 1/3 as fast.

0c24fae FastSerializer: Also use cache for writing to ForMerge if we are inside mark()
sax/source/tools/CachedOutputStream.hxx | 37 +++++++++++++++++++--
sax/source/tools/fastserializer.cxx | 53 +++++++++++++++++++------------
sax/source/tools/fastserializer.hxx | 12 ++++---
3 files changed, 75 insertions(+), 27 deletions(-)

Upstream: cgit.freedesktop.org


  • Share