all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: emacs-devel@gnu.org
Subject: Re: [elpa] master 5640cd0 04/12: el-search: some comment changes
Date: Mon, 12 Oct 2015 11:46:20 +0200	[thread overview]
Message-ID: <878u78s9lf.fsf@web.de> (raw)
In-Reply-To: CAAdUY-JJyTjhPUhdTQWiAgfZzxpZJDAw4xo9mUL005SKqFY4iQ@mail.gmail.com

Artur Malabarba <bruce.connor.am@gmail.com> writes:

> On 11 Oct 2015 11:33 am, "Michael Heerdegen" <michael_heerdegen@web.de>
> wrote:
> > + ;; FIXME: an interesting alternative would be to really integrate it
> > + ;; with Isearch, using `isearch-search-fun-function'.
> > + ;; Alas, this is not trivial if we want to transfer our optimizations.
> > (interactive)
> > (el-search-pattern
> > (el-search--read-pattern
>
> Can you explain why? I've been thinking of making some refactorings to
> isearch (after the feature freeze) and I could try to extend
> isearch-search-fun-function to cover your use case if it's not too
> hard.

That's great news.  When I added the "this is not trivial if we want to
transfer our optimizations" to the comment, I didn't take changing
isearch itself into account.

I use two optimization techniques at the moment:

(1) Cache the current expanded pcase call, to avoid costly repeated pcase
expansion.  Probably not problematic wrt isearch.

(2) The most time consuming part while searching is getting to the start
of the next sexp, because it is done so often.

The optimization I recently added factors the function that does that
into two parts:

  - The first part is called only when starting a new search.  It
  performs costly tests (calling syntax functions), moves out of
  comments, and such stuff.  It guarantees to leave point at a position
  that fulfills a certain set of conditions, let's call it C.

  - The second part is very fast.  Once C holds, it's sufficient to call
  it repeatedly.

(2) makes a huge change in efficiency (factor 5 or so).  The problem is
that because of (2), it's not possible to pass a function to isearch
that finds the next match from any place and is optimized in that way.

If you have an idea how to optimize the "move point to the next start of
an expression" further or better, I'm open ear.

BTW, I don't yet have implemented backward searching.


Regards,

Michael.





      reply	other threads:[~2015-10-12  9:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20151011103325.2269.2052@vcs.savannah.gnu.org>
     [not found] ` <E1ZlDwV-0000c5-Vx@vcs.savannah.gnu.org>
2015-10-11 23:29   ` [elpa] master 5640cd0 04/12: el-search: some comment changes Artur Malabarba
2015-10-12  9:46     ` Michael Heerdegen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878u78s9lf.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.