[ https://issues.apache.org/jira/browse/PIG-965?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12791096#action_12791096 ]
Ankit Modi commented on PIG-965: -------------------------------- Here are numbers comparing comparing optimization 1&2 against optimization 1 & dk.brics dk.brics.Runautomaton is as fast as optimization 2 and also provides similar speeds in a set of additional expressions. || Query || svn_trunk || std_dev || Optimization 1 & 2 || std_dev || Optimization 1 & brics.RunAutomaton || std_dev || | .\*ABCD.\* | 33.87 | 0.71 | 18.77 | 0.71 | 18.94 | 0.02 | | .\*ABCD | 30.06 | 2.91 | 18.44 | 0.05 | 18.94 | 0.03 | | ABCD.\* | 21.93 | 2.91 | 18.35 | 0.1 | 18.85 | 0.04 | Values are averaged over 3 runs. > PERFORMANCE: optimize common case in matches (PORegex) > ------------------------------------------------------ > > Key: PIG-965 > URL: https://issues.apache.org/jira/browse/PIG-965 > Project: Pig > Issue Type: Improvement > Components: impl > Reporter: Thejas M Nair > Assignee: Ankit Modi > Attachments: automaton.jar, poregex2.patch > > > Some frequently seen use cases of 'matches' comparison operator have follow > properties - > 1. The rhs is a constant string . eg "c1 matches 'abc%' " > 2. Regexes such that look for matching prefix , suffix etc are very common. > eg - "abc%', "%abc", '%abc%' > To optimize for these common cases , PORegex.java can be changed to - > 1. Compile the pattern (rhs of matches) re-use it if the pattern string has > not changed. > 2. Use string comparisons for simple common regexes (in 2 above). > The implementation of Hive like clause uses similar optimizations. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.