Avoid writing unchanged data to terms dbs
ClosedPublic

Authored by bruns on Nov 27 2018, 8:17 PM.

Details

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

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bruns created this revision.Nov 27 2018, 8:17 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptNov 27 2018, 8:17 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Nov 27 2018, 8:17 PM
ngraham accepted this revision.Nov 28 2018, 12:28 AM

Makes sense, thanks!

This revision is now accepted and ready to land.Nov 28 2018, 12:28 AM
This revision was automatically updated to reflect the committed changes.