<div dir="ltr">On Sun, May 31, 2015 at 10:57 AM, Colomban Wendling <span dir="ltr"><<a href="mailto:lists.ban@herbesfolles.org" target="_blank">lists.ban@herbesfolles.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Le 31/05/2015 07:41, Lex Trotman a écrit :<br>
> On 31 May 2015 at 11:46, Lex Trotman <<a href="mailto:elextr@gmail.com">elextr@gmail.com</a>> wrote:<br>
>> On 31 May 2015 at 08:05, Thomas Martitz <<a href="mailto:kugel@rockbox.org">kugel@rockbox.org</a>> wrote:<br>
>>> Am 30.05.2015 um 03:19 schrieb Matthew Brush:<br>
>>>><br>
>>>><br>
>>>> Just because it's such a trivial search algorithm, using strstr() is much<br>
>>>> more simple and probably more efficient than using Scintilla's API to find<br>
</span>>>>> text, […]<br>
<span class="">>><br>
>> So its almost certainly slower than strstr().<br>
><br>
> And on my system strstr() is a builtin that can use any hardware<br>
> support available.<br>
<br>
</span>One thing that will make strstr() sound a lot less sexy is that you<br>
probably actually want to find *words* rather than substrings.  Meaning<br>
that if the word under the cursor is "i", you probably don't want to<br>
highlight all "i"s in e.g. an identifier "highlighting", but only whole<br>
words.  And while Scintilla search has the logic for this<br>
(SCFIND_WHOLEWORD), it'd probably be annoying/redundant to re-do with<br>
the same logic.<br>
<br>
Apart that, yes, strstr() from an optimized libc like glibc will be hard<br>
to beat without also using very smart optimization combined with use of<br>
specialized CPU instruction sets.<br>
<br>
Cheers,<br>
Colomban<br>
<div class="HOEnZb"><div class="h5"><br></div></div></blockquote><div><br></div><div>Just to clarify, when I mentioned strstr(), I meant it as an example of using some existing implementation (instead of creating something new) rather than suggesting strstr() is the "best" one. If there's something in Scintilla which would make it easier to implement this feature, just go for it. If there's some performance problem, it can always be improved afterwards (but I don't think there will be any).</div><div><br></div><div>Regards,</div><div><br></div><div>Jiri</div></div></div></div>