[Geany-Devel] pull request on GitHub, to add GeanyHighlightSelectedWords, into Geany Plugins
techet at xxxxx
Mon Jun 1 16:23:27 UTC 2015
On Sun, May 31, 2015 at 10:57 AM, Colomban Wendling <
lists.ban at herbesfolles.org> wrote:
> Le 31/05/2015 07:41, Lex Trotman a écrit :
> > On 31 May 2015 at 11:46, Lex Trotman <elextr at gmail.com> wrote:
> >> On 31 May 2015 at 08:05, Thomas Martitz <kugel at rockbox.org> wrote:
> >>> Am 30.05.2015 um 03:19 schrieb Matthew Brush:
> >>>> Just because it's such a trivial search algorithm, using strstr() is
> >>>> more simple and probably more efficient than using Scintilla's API to
> >>>> text, […]
> >> So its almost certainly slower than strstr().
> > And on my system strstr() is a builtin that can use any hardware
> > support available.
> One thing that will make strstr() sound a lot less sexy is that you
> probably actually want to find *words* rather than substrings. Meaning
> that if the word under the cursor is "i", you probably don't want to
> highlight all "i"s in e.g. an identifier "highlighting", but only whole
> words. And while Scintilla search has the logic for this
> (SCFIND_WHOLEWORD), it'd probably be annoying/redundant to re-do with
> the same logic.
> Apart that, yes, strstr() from an optimized libc like glibc will be hard
> to beat without also using very smart optimization combined with use of
> specialized CPU instruction sets.
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).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Devel