DescriptionAvoid fragmenting the heap too much while reconstructing the index.
Memory analysis exposed that FileEnumerator doesn't scale well on very large
directories (e.g. ~80 000 entries) due to the high amount of heap allocations
it is performing causing unexpectedly high heap fragmentation (e.g. ~5 MBytes
with a 80 000 files directory).
This CL makes SimpleIndexFile::SyncRestoreFromDisk() use directly readdir_r()
on POSIX and fallback to FileEnumerator on Windows. The code path triggered for
reconstructing the index from disk now causes a 40 KBytes RAM overhead (on the
cache that was used for testing) vs the 5 initial MBytes.
BUG=272062
R=gavinp@chromium.org, pasko@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=219017
Patch Set 1 : #
Total comments: 8
Patch Set 2 : Address Gavin's comments #Patch Set 3 : Remove uses of vector::data() which is C++11 only #
Total comments: 13
Patch Set 4 : Address Egor's and Gavin's comments #
Total comments: 14
Patch Set 5 : Address Gavin's comment #Patch Set 6 : Address Egor's comments #Patch Set 7 : Speculative fix for Windows #Patch Set 8 : Fix windows build (part 2) #
Messages
Total messages: 15 (0 generated)
|