From: Ihor Radchenko <yantar92@posteo.net>
To: tomas@tuxteam.de
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Should `get-file-buffer' be implemented in Elisp?
Date: Mon, 17 Jul 2023 09:28:50 +0000 [thread overview]
Message-ID: <87r0p6zy25.fsf@localhost> (raw)
In-Reply-To: <ZLTMOlSXebEvan84@tuxteam.de>
<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>
next prev parent reply other threads:[~2023-07-17 9:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-16 18:40 Should `get-file-buffer' be implemented in Elisp? Ihor Radchenko
2023-07-16 18:51 ` Eli Zaretskii
2023-07-16 19:05 ` Ihor Radchenko
2023-07-16 19:10 ` Eli Zaretskii
2023-07-16 20:19 ` Ihor Radchenko
2023-07-16 23:28 ` Po Lu
2023-07-17 5:06 ` tomas
2023-07-17 9:28 ` Ihor Radchenko [this message]
2023-07-17 13:11 ` Eli Zaretskii
2023-07-17 17:48 ` tomas
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r0p6zy25.fsf@localhost \
--to=yantar92@posteo.net \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=tomas@tuxteam.de \
/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 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).