Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 565457 - CDB settings provider/parser's automatic exclusion of files is very slow
Summary: CDB settings provider/parser's automatic exclusion of files is very slow
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: Next   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 10.0.0   Edit
Assignee: Marc-André Laperle CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-22 23:32 EDT by Marc-André Laperle CLA
Modified: 2020-08-03 22:28 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Laperle CLA 2020-07-22 23:32:21 EDT
In the "Compilation Database Parser" language settings provider, you can select the option "Exclude files not in the Compilation Database". This is very useful to save a lot of time in project setup. Unfortunately, the way it works is suboptimal when in the presence of a large number of excluded files, say thousands. The way it works is simple, it excludes files one by one which means thousands of filtered patterns in the source folder entry.

In a test with the LLVM code base (including Clang, LLDB, etc), processing and applying exclusions from the CDB can take 10 minutes alone. What's worse, the UI presented to the user when looking at filtered patterns in the source folder is very large and slow. Many places also in CDT call CDataUtil.isExcluded which gets very slow when you have a large number of exclusion patterns.

I see two possible (non-exclusive) solutions:
1) Optimize CDataUtil.isExcluded to have reasonable performance with thousands of patterns
2) Implement a smarter exclusion algorithm to exclude whole folders when possible

Since #1 alone does not solve the bloated UI, I will favor solution #2 as the fix for now.
Comment 1 Eclipse Genie CLA 2020-07-23 00:27:04 EDT
New Gerrit change created: https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/166685
Comment 3 Marc-André Laperle CLA 2020-08-03 22:28:17 EDT
It's down to ~2 sec with LLVM code base with solution #2, so I think it's much more reasonable for now.