all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Question: estimating size of a buffer when written to file?
@ 2021-12-08 15:33 Qiantan Hong
  2021-12-08 15:52 ` Stephen Berman
  2021-12-08 17:03 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Qiantan Hong @ 2021-12-08 15:33 UTC (permalink / raw)
  To: emacs-devel@gnu.org

Is there any reliable way to get (or conservatively estimate) 
the size of a buffer when written to file?

I’m thinking about using it for an optimization for persistent kv store.
If we know a log entry, when written out, is shorter than PIPE_BUF,
then we can skip the file locking/unlocking.
Emacs lock file doesn’t seem to be particularly fast.

Best,
Qiantan


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

end of thread, other threads:[~2021-12-08 17:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-08 15:33 Question: estimating size of a buffer when written to file? Qiantan Hong
2021-12-08 15:52 ` Stephen Berman
2021-12-08 15:55   ` Qiantan Hong
2021-12-08 16:01     ` Stephen Berman
2021-12-08 16:29       ` Daniel Martín
2021-12-08 17:03 ` Stefan Monnier
2021-12-08 17:09   ` Qiantan Hong

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.