Diffusion Baloo aff58c04b5dd

Avoid writing unchanged data to terms dbs

Authored by bruns on Nov 26 2018, 8:34 PM.

Description

Avoid writing unchanged data to terms dbs

Summary:
The termlist returned from replaceTerms may be identical to the current
DB contents. Avoid blowing up the write transaction by commits which are
actually noops. CPU cycles are cheaper than disk writes and flushes.

Comparing old and new terms is typically cheap (adding or removing files
changes the term list size). File updates often do not change the terms
for all DBs, e.g. a rename changes the ctime and also triggers an update
of the XAttr entry and vice versa. Appending to a file or doing any other
action which changes the mtime triggers a DocumentTermsDB update, while
the set of unique terms may be unchanged.

Test Plan: ctest

Reviewers: Baloo, Frameworks, ngraham, poboiko

Reviewed By: Baloo, ngraham

Subscribers: kde-frameworks-devel

Tags: Frameworks, Baloo

Differential Revision: https://phabricator.kde.org/D17200

Details

Committed
brunsNov 29 2018, 10:32 PM
Reviewer
Baloo
Differential Revision
D17200: Avoid writing unchanged data to terms dbs
Parents
R293:707beb19da7c: Reserve space in pending operations vector
Branches
Unknown
Tags
Unknown