Bug 578605 - [performance] add java.nio.file.FileVisitor like ElementTreeIterator
Summary: [performance] add java.nio.file.FileVisitor like ElementTreeIterator
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 4.23   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-06 15:47 EST by Jörg Kubitz CLA
Modified: 2022-02-06 16:45 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jörg Kubitz CLA 2022-02-06 15:47:00 EST
Some Visitors like that in "MarkerManager.visitorFindMaxSeverity" could stop early if some condition apply (in that case max Severity reached). But the IElementContentVisitor does not allow an early stop. It only allows to stop that further "*children* should be visited". Siblings (and there descendends!) are still executed leading to unnecessary work.
Would be good to add a new API or extend ElementTreeIterator like java.nio.file.FileVisitor which does allow to stop at various situations.
Also it would look nicer in stacktraces if it's not recursive but iterative like in java.nio.file.Files.walkFileTree().

... and then use it for findMaxProblemSeverity!
Comment 1 Andrey Loskutov CLA 2022-02-06 16:45:34 EST
Haven't checked code yet, but widely used pattern would be to throw OperationCancelledException from visitor and catch in the iterator.