all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: master 3e5298f: Improve performance of seq-union
       [not found] ` <20210917120200.1851D20ABE@vcs0.savannah.gnu.org>
@ 2021-09-27 14:57   ` Robert Pluim
  2021-09-27 15:07     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Robert Pluim @ 2021-09-27 14:57 UTC (permalink / raw)
  To: emacs-devel; +Cc: Stefan Kangas

>>>>> On Fri, 17 Sep 2021 08:01:59 -0400 (EDT), stefankangas@gmail.com (Stefan Kangas) said:

    Stefan> branch: master
    Stefan> commit 3e5298fc96c98d2296432d31ee1d3de86a4c466c
    Stefan> Author: Stefan Kangas <stefan@marxist.se>
    Stefan> Commit: Stefan Kangas <stefan@marxist.se>

    Stefan>     Improve performance of seq-union
    
    Stefan>     * lisp/emacs-lisp/seq.el (seq-union): Improve performance by using
    Stefan>     nreverse instead of seq-reverse.

Utterly idle thought: would packages that tend to generate long lists
and reverse them, such as Gnus, benefit from a builtin-in queue data
type that supported efficient appending?

Robert
-- 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 3e5298f: Improve performance of seq-union
  2021-09-27 14:57   ` master 3e5298f: Improve performance of seq-union Robert Pluim
@ 2021-09-27 15:07     ` Lars Ingebrigtsen
  2021-09-27 15:09       ` Lars Ingebrigtsen
  2021-09-27 15:21       ` Robert Pluim
  0 siblings, 2 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-27 15:07 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Stefan Kangas, emacs-devel

Robert Pluim <rpluim@gmail.com> writes:

> Utterly idle thought: would packages that tend to generate long lists
> and reverse them, such as Gnus, benefit from a builtin-in queue data
> type that supported efficient appending?

A new data structure that has both head and a tail pointer?  I think
you'd be hard pressed to get that to be faster than push+nreverse unless
you implement it in C -- nreverse is very fast.

But I could be wrong.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 3e5298f: Improve performance of seq-union
  2021-09-27 15:07     ` Lars Ingebrigtsen
@ 2021-09-27 15:09       ` Lars Ingebrigtsen
  2021-09-27 15:21       ` Robert Pluim
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-27 15:09 UTC (permalink / raw)
  To: Robert Pluim; +Cc: Stefan Kangas, emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> A new data structure that has both head and a tail pointer?  I think
> you'd be hard pressed to get that to be faster than push+nreverse unless
> you implement it in C -- nreverse is very fast.

(I mean -- for lists of lengths you'd be likely to see in something like
Gnus.  If you operate on lists that are billions of elements long, then
sure.)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 3e5298f: Improve performance of seq-union
  2021-09-27 15:07     ` Lars Ingebrigtsen
  2021-09-27 15:09       ` Lars Ingebrigtsen
@ 2021-09-27 15:21       ` Robert Pluim
  1 sibling, 0 replies; 4+ messages in thread
From: Robert Pluim @ 2021-09-27 15:21 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Stefan Kangas, emacs-devel

>>>>> On Mon, 27 Sep 2021 17:07:39 +0200, Lars Ingebrigtsen <larsi@gnus.org> said:

    Lars> Robert Pluim <rpluim@gmail.com> writes:
    >> Utterly idle thought: would packages that tend to generate long lists
    >> and reverse them, such as Gnus, benefit from a builtin-in queue data
    >> type that supported efficient appending?

    Lars> A new data structure that has both head and a tail pointer?  I think
    Lars> you'd be hard pressed to get that to be faster than push+nreverse unless
    Lars> you implement it in C -- nreverse is very fast.

Intuitively, such a data structure needs to do less work than
nreverse, but it has to maintain the tail pointer, which should be a
net win.

    Lars> But I could be wrong.

Iʼve not implemented and measured it :-)

Robert
-- 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-27 15:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20210917120158.21934.71974@vcs0.savannah.gnu.org>
     [not found] ` <20210917120200.1851D20ABE@vcs0.savannah.gnu.org>
2021-09-27 14:57   ` master 3e5298f: Improve performance of seq-union Robert Pluim
2021-09-27 15:07     ` Lars Ingebrigtsen
2021-09-27 15:09       ` Lars Ingebrigtsen
2021-09-27 15:21       ` Robert Pluim

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.