Bug 436673 - Potential performance issue with Errorparsers based on ErrorPattern
Summary: Potential performance issue with Errorparsers based on ErrorPattern
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build (show other bugs)
Version: 8.3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-build-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-05 05:44 EDT by Johann Draschwandtner CLA
Modified: 2020-09-04 15:21 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johann Draschwandtner CLA 2014-06-05 05:44:13 EDT
Build output ErrorParsers usnig ErrorPattern might cause performance issues.

The matching of the pattern is done via
matcher.find()

This will try to apply the pattern on any position on the built output line and is very unperformant compared to
matcher.matches()

There might be regular expressions that need to be reworked, but what I found most of the regex could be applied using matcher.matches()
Comment 1 Andrew Gvozdev CLA 2014-06-09 18:52:13 EDT
Do you intend to develop a patch and submit it into gerrit? If you do run unit tests. Error parsers are covered by unit tests pretty well so if the tests pass you can be confident
Comment 2 Martin Oberhuber CLA 2014-06-13 13:12:15 EDT
CQ:WIND00-WB4-3624

Just wondering, how is this problem different than what we got fixed with
https://bugs.eclipse.org/bugs/show_bug.cgi?id=419207 ?
Comment 3 Johann Draschwandtner CLA 2014-06-16 02:26:43 EDT
The difference is that the matcher.find pattern in but 419207 was matched and afterwards a check whether for a match of the whole line was done.
e.g.
matcher.find() && matcher.group(0).length()==line.length()

this is 100% equal to matcher.matches().


In this report the matcher.find() isn't checked for the whole line. So
depending on the regular expression used it might be the case that it
matches a substring, if this is reworked to use matcher.matches() the regular
expressions will need some double checking.