The number of lines, the length of the lines, the number of patterns, the length of the patters, and what the patterns are can all have an effect on performance. You haven't provided any data to help narrow it down. For example, some patterns will take longer than the life of the universe to match.