introduce Calc cache for sorted handling of unsorted cells

Desktop / LibreOffice - Luboš Luňák [collabora.com] - 11 May 2022 09:46 UTC

The idea is that there's a cache for a given range, which keeps a vector of SCROW items, sorted by values of those cells. This allows some specific cases of e.g. COUNTIF to simply use BinarySearch() to find the range that matches and work only with that. This commit implements using this cache for COUNTIF.

Change-Id: I5b36b289b4aecb3b8245bbb447fbb299371262e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134120

122e676ce35b introduce Calc cache for sorted handling of unsorted cells
sc/Library_sc.mk | 1 +
sc/inc/document.hxx | 4 +
sc/inc/interpretercontext.hxx | 4 +
sc/inc/lookupcache.hxx | 4 +-
sc/inc/queryiter.hxx | 56 +++++++-
sc/inc/rangecache.hxx | 109 ++++++++++++++++
sc/qa/unit/ucalc_sort.cxx | 2 +-
sc/source/core/data/documen2.cxx | 45 +++++++
sc/source/core/data/queryiter.cxx | 202 ++++++++++++++++++++++++++++-
sc/source/core/tool/interpr1.cxx | 15 ++-
sc/source/core/tool/interpretercontext.cxx | 19 ++-
sc/source/core/tool/lookupcache.cxx | 11 --
sc/source/core/tool/rangecache.cxx | 67 ++++++++++
13 files changed, 508 insertions(+), 31 deletions(-)

Upstream: cgit.freedesktop.org


  • Share