* Re: [elpa] master 5640cd0 04/12: el-search: some comment changes
[not found] ` <E1ZlDwV-0000c5-Vx@vcs.savannah.gnu.org>
@ 2015-10-11 23:29 ` Artur Malabarba
2015-10-12 9:46 ` Michael Heerdegen
0 siblings, 1 reply; 2+ messages in thread
From: Artur Malabarba @ 2015-10-11 23:29 UTC (permalink / raw)
To: Michael Heerdegen, emacs-devel; +Cc: emacs-elpa-diffs
[-- Attachment #1: Type: text/plain, Size: 581 bytes --]
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.
Best,
Artur
[-- Attachment #2: Type: text/html, Size: 784 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [elpa] master 5640cd0 04/12: el-search: some comment changes
2015-10-11 23:29 ` [elpa] master 5640cd0 04/12: el-search: some comment changes Artur Malabarba
@ 2015-10-12 9:46 ` Michael Heerdegen
0 siblings, 0 replies; 2+ messages in thread
From: Michael Heerdegen @ 2015-10-12 9:46 UTC (permalink / raw)
To: emacs-devel
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-12 9:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[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
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).