On Thu, 03 Jan 2013 11:40:31 +0100, Gustavo Lopes <glopes@nebm.ist.utl.pt> wrote:
The algorithm behaves very poorly in this case because at each position of the text, all the substrings starting there and with size between m and n (where m is the size of the smallest pattern and n is the largest) are checked, even if there are only two patterns with size m and n. We could fix this easily by building a set of the pattern sizes found and try only with those. The hashing of the substrings could also be improved; we don't have to recalculate everything when we advance in the text.
Both optimizations (the hash rolling and limiting the substrings hashed on each iteration) worked quite well.
But I got much better results with another algorithm [1], so I'm going to merge the branch with it [2] instead.
OK, so now the plan is to merge this onto 5.4: