ntfs压缩 数据恢复_NTFS压缩文件是否已解压缩到磁盘或内存?
ntfs压缩 数据恢复
If you are looking for ways to tweak your Windows system to conserve disk space, you might be looking at NTFS compression as an option. But if you choose this option, then how does the decompression process work? Today’s SuperUser Q&A post has the answer to a curious reader’s question.
如果您正在寻找调整Windows系统以节省磁盘空间的方法,则可能会将NTFS压缩作为一种选择。 但是,如果选择此选项,那么减压过程如何工作? 今天的“超级用户问答”帖子回答了一个好奇的读者的问题。
Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.
今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。
问题 (The Question)
SuperUser reader CausingUnderflowsEverywhere wants to know if NTFS compressed files are decompressed to disk or memory:
超级用户阅读器CausingUnderflowsEverywhere都想知道是否将NTFS压缩文件解压缩到磁盘或内存中:
How does NTFS decompression work in Windows? According to Microsoft, NTFS decompression is done by expanding the file, then using it. That sounds right, but my question is how does this process occur technically?
Windows中NTFS减压如何工作? 根据Microsoft的说法,NTFS解压缩是通过扩展文件然后使用它来完成的。 听起来不错,但我的问题是,该过程在技术上如何发生?
Does Windows load the compressed file into memory, expand it in memory, then read it from memory? Or does it load the compressed file into memory, expand it to disk or memory, write it to disk, then read it?
Windows是否将压缩文件加载到内存中,在内存中扩展它,然后从内存中读取它? 还是将压缩文件加载到内存中,将其扩展到磁盘或内存,将其写入磁盘然后读取?
I am trying to figure out if I can improve my computer’s performance by using NTFS compression. That way, a slow hard drive or SSD that is unable to handle that many write operations will always have less data to write and read, and the powerful processor that is idling most of the time can decompress the files and improve my computer’s storage speed and health.
我试图找出是否可以通过使用NTFS压缩来提高计算机的性能。 这样,无法处理许多写入操作的慢速硬盘驱动器或SSD总是要写入和读取的数据更少,而大多数时间处于空闲状态的强大处理器可以解压缩文件并提高计算机的存储速度,健康。
Are NTFS compressed files decompressed to disk or memory?
NTFS压缩文件是否已解压缩到磁盘或内存中?
答案 (The Answer)
SuperUser contributor Ben N has the answer for us:
超级用户贡献者Ben N为我们提供了答案:
Windows decompresses files into memory. Doing it to disk would completely obliterate any speed improvements and would cause a lot of unnecessary disk writing. See the end of this Microsoft blog article on NTFS sparse files and compression.
Windows将文件解压缩到内存中。 在磁盘上执行此操作将完全消除任何速度改进,并会导致许多不必要的磁盘写入。 请参阅此Microsoft博客文章的末尾有关NTFS稀疏文件和压缩的信息。
![]()
Of course, if you are low on memory, the memory used by the decompression process could cause other memory be paged out and written to disk in the page file. Fortunately, only the chunks containing sections that your programs actually read will be decompressed. NTFS does not have to decompress the whole thing if you only need a few bytes.
当然,如果内存不足,则解压缩过程使用的内存可能会导致其他内存被分页并写入页面文件中的磁盘。 幸运的是,只有包含程序实际读取的节的块才会被解压缩。 如果只需要几个字节,则NTFS不必解压缩整个内容。
If your SSD is fast, you are probably not going to get any speed improvements from NTFS compression. It is conceivable that the time your processor spends decompressing data plus the time your disk spends reading the compressed data could add up to be more than the time your SSD takes to read the uncompressed data.
如果您的SSD速度很快,则可能不会从NTFS压缩中获得任何速度上的提高。 可以想象,处理器花费在解压缩数据上的时间与磁盘花费在读取压缩数据上的时间之和可能大于SSD读取未压缩数据所花费的时间。
It also depends on the size of the files you work with. The minimum size of a compressible file ranges from 8 – 64 KB, depending on your cluster size. Any files less than that in size will not be compressed at all, but a tiny amount of bookkeeping would be added. If you do a lot of writing to compressed files, you could see a lot of variance in speed due to the compression algorithm used (LZ).
它还取决于您使用的文件的大小。 可压缩文件的最小大小为8 – 64 KB,具体取决于您的群集大小。 小于该大小的任何文件都不会被压缩,但是会添加少量的簿记。 如果您对压缩文件进行大量写入操作,则由于使用的压缩算法(LZ)可能会导致速度差异很大。
Further Reading
进一步阅读
Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.
有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程。
Image Credit: Jannis Andrija Schnitzer (Flickr)
图片来源: Jannis Andrija Schnitzer(Flickr)
翻译自: https://www.howtogeek.com/286931/are-ntfs-compressed-files-decompressed-to-disk-or-memory/
ntfs压缩 数据恢复