Reuse existing elements of PathFilter::m_items
This elimination of memory reallocation, redundant ProjectFile construction and destruction, dramatically speeds up ProjectFileDataProvider::reset() when a huge project is open. Consider WebKit project with almost 320 thousand files in total and 13 of these files open: the average time spent in ProjectFileDataProvider::reset() went from 80 ms to 7 ms (starting from the second call to this function, because memory is still allocated and all ProjectFile objects are still created in the first call to it). BenchQuickOpen::benchProjectFileFilter_reset() runs 8 times faster with this change.
Please register or sign in to comment