[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiling Elisp to a native code with a GCC plugin
From: |
Stefan Monnier |
Subject: |
Re: Compiling Elisp to a native code with a GCC plugin |
Date: |
Wed, 15 Sep 2010 17:42:26 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
> So you end up with
> (or (looking-at "foo ") (search-forward "\nfoo "))
> which creates a regexp, anyway, and seems clumsy.
Unless the text you match is short, the above is probably the fastest, indeed.
There is no built-in support for the above idiom, OTOH, so you have to
pay for the extra Elisp interpretation overhead of calling looking-at
and then search-forward.
> So what I wonder is whether there is a smarter way to do this, in
> general. (I'm assuming that a simple string search is faster than a
> regexp search, but I've never actually benchmarked this.)
A simple string search is indeed faster and uses one of those algorithms
that are faster for longer search strings.
Stefan
- Re: Compiling Elisp to a native code with a GCC plugin, (continued)
- Re: Compiling Elisp to a native code with a GCC plugin, Stefan Monnier, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, Helmut Eller, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, Stefan Monnier, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, Lars Magne Ingebrigtsen, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, Andreas Schwab, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, Lars Magne Ingebrigtsen, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, Andreas Schwab, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, Lars Magne Ingebrigtsen, 2010/09/16
- Re: Compiling Elisp to a native code with a GCC plugin,
Stefan Monnier <=
- Re: Compiling Elisp to a native code with a GCC plugin, Lars Magne Ingebrigtsen, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, Leo, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, Lars Magne Ingebrigtsen, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, David Kastrup, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, Leo, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, David Kastrup, 2010/09/15
- Re: Compiling Elisp to a native code with a GCC plugin, Lars Magne Ingebrigtsen, 2010/09/16
- Re: Compiling Elisp to a native code with a GCC plugin, Andreas Schwab, 2010/09/16
- Re: Compiling Elisp to a native code with a GCC plugin, Lars Magne Ingebrigtsen, 2010/09/16
- Re: Compiling Elisp to a native code with a GCC plugin, Eli Zaretskii, 2010/09/17