emacs-devel
[Top][All Lists]
Advanced

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

Re: Should `get-file-buffer' be implemented in Elisp?


From: Ihor Radchenko
Subject: Re: Should `get-file-buffer' be implemented in Elisp?
Date: Mon, 17 Jul 2023 09:28:50 +0000

<tomas@tuxteam.de> writes:

> On Sun, Jul 16, 2023 at 08:19:10PM +0000, Ihor Radchenko wrote:
>
> [...]
>
>> scenarios. And in general lookup as well as hash tables start to
>> outperform alists just at 20-30 elements [1]
>
> For me, it's more like 45-ish:

Right. The link I provided actually also mentions similar number.

> How many people around here have regularly 1000 buffers?

Well. Check out https://github.com/org-roam/org-roam
People routinely deal with thousands of buffers there and complain about
that.

I also did a benchmark for opening several thousands of files in Emacs
and the performance was quite disappointing. (Though, admittedly, not
because of `get-file-buffer').

> And even at 100, the absolute time is rather negligible. Somewhere
> near 5000 buffers my (not very fast) machine reaches the 100ms
> area for alists and lingers in the 2ms area for hashes (that would
> be where I'd start worrying).

100ms is fast when you do it once. But `get-file-buffer' may be called
rather frequently by `with-temp-buffer'. 

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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