[Inotify] Remove not-so-OptimizedByteArray
ClosedPublic

Authored by bruns on Mar 27 2020, 2:42 AM.

Details

Summary

The OptimizedByteArray may have been beneficial on 32bit archs, are less
likely so on 64bit archs, and the possible gains are not worth the
extra complexity.

The OptimizedByteArray stores each path component as a separate
QByteArray, shared over all directories. As each of these references
amounts to a d-pointer, the minimal cost is 4/8 bytes (fully amortized),
the maximum cost is 4/8 bytes + 16/24 bytes (QByteArray overhead) +
strlen(component) + 1 + padding/alignment + libc alloc overhead (unique
component name).

I.e. for each watched directory where the average path component length
it is a definite loss, for longer average length it depends on how often
a long component is shared.

As each component is permanently cached in a QSet this also leaks
memory.

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.Mar 27 2020, 2:42 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptMar 27 2020, 2:42 AM
Restricted Application added subscribers: Baloo, kde-frameworks-devel. · View Herald Transcript
bruns requested review of this revision.Mar 27 2020, 2:42 AM
bruns updated this revision to Diff 78608.Mar 27 2020, 2:45 AM
bruns edited the summary of this revision. (Show Details)
bruns added reviewers: Baloo, ngraham.

summary

ngraham accepted this revision.Apr 7 2020, 3:07 PM
This revision is now accepted and ready to land.Apr 7 2020, 3:07 PM
This revision was automatically updated to reflect the committed changes.