[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC] Some new vector procedures (vector-{memq, apply, to-string, ..

From: Stefan Monnier
Subject: Re: [RFC] Some new vector procedures (vector-{memq, apply, to-string, ...})
Date: Sun, 21 Apr 2019 00:05:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> I don't see any replacement for vector-apply, but I admit that the worth
> of that one might not be worth the change at this point.

I'm not sure I like vector-apply, but I am interested in doing something
along these lines for cl-generic: the use of wrappers of the form

    (lambda (x &rest args) ... (apply f x args))

proves to be too costly in some cases (e.g. cl-print).  But the main issue
seems to be the allocation of a new list for `args`, so `vector-apply`
doesn't really help here.

> For vector-memq, the Lisp implementations almost disallow it from being
> used over memq/lists.

I your `vector-memq` significantly faster than `memq`?
My impression is that for small enough "sets", even if a bit faster,
`vector-memq` wouldn't bring much benefit, and for larger sets if
performance is an issue you'd likely prefer using a completely different
structure such as a hash-table.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]