Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* Question about btrfs compression
@ 2024-05-23 18:32 Sijie Lan
  2024-05-28 16:06 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Sijie Lan @ 2024-05-23 18:32 UTC (permalink / raw)
  To: linux-btrfs, wqu

As described in
https://archive.kernel.org/oldwiki/btrfs.wiki.kernel.org/index.php/Compression.html.
"The compression processes ranges of a file of maximum size 128 KiB
and compresses each 4 KiB (or page-sized) block separately. Accessing
a byte in the middle of the given 128 KiB range requires to decompress
the whole range. This is not optimal and is subject to optimizations
and further development."

Since Btrfs compresses each 4KiB block of data separately. My question
is that when randomly accessing some of the bytes in the entire
compressed chunk, decompressing some of the bytes in the entire chunk
seems to be much more efficient than decompressing the entire range
(128 KiB), but the current method still decompresses the entire 128KiB
chunk when accessing some of the bytes in the chunk (e.g., 4KiB). So
why is it not optimized for this, is it a basic implementation
difficulty or something else?

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

end of thread, other threads:[~2024-05-28 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-23 18:32 Question about btrfs compression Sijie Lan
2024-05-28 16:06 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox