in reply to Re^2: How Index function works??
in thread How Index function works??
If you don't mind, could you post the benchmark code? I'm just curious to look it over.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How Index function works??
by LanX (Saint) on Oct 24, 2011 at 09:15 UTC | |
well it was in June, below what I found on my disk: There is an "X" in the middle of a 52MB string of repeated alphabet letters ($pattern = join "","a".."z") Depending if you look for "Xabc..xyz" or "abc...xyzX" the different approaches show their strength. I did more tests which I can't find anymore strongly indicating that index doesn't use Boyer-Moore. Just vary the position of the "X". I'd be glad if you looked it over. :)
RESULT:
Cheers Rolf | [reply] [d/l] [select] |
by Corion (Patriarch) on Oct 24, 2011 at 09:57 UTC | |
It's not that index doesn't use Boyer Moore, it's more that the regex engine doesn't always use Boyer Moore. If the regex engine comes to the conclusion to use screaminstr, it will use that instead of Boyer Moore. I guess that if you change your data to be more favorable to Boyer Moore, the results will reverse as the regular expression will still not use Boyer Moore. Update: Even weirder. Looking at the log of use re 'Debug','ALL';, it claims that fbm_instr() is used:
So, I don't understand what happens, or how the RE engine is faster than index when they both fire up fbm_instr. | [reply] [d/l] [select] |
by LanX (Saint) on Oct 24, 2011 at 10:13 UTC | |
Cheers Rolf | [reply] |