使用FILE_FLAG_NO_BUFFERING会返回明显的速度增益吗? [英] Using FILE_FLAG_NO_BUFFERING will return noticeable speed gain?

查看:79
本文介绍了使用FILE_FLAG_NO_BUFFERING会返回明显的速度增益吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近注意到MSDN中FILE_FLAG_NO_BUFFERING标志的详细描述,并读取了一些有关Windows中未缓冲I/O的Google搜索结果.

Recently noticed detail description of FILE_FLAG_NO_BUFFERING flag in MSDN, and read several Google search results about unbuffered I/O in Windows.

http://msdn.microsoft.com/en-us/library/aa363858(v = vs.85).aspx

我现在想知道,在文件I/O编程中考虑非缓冲选项真的很重要吗?因为许多程序都使用普通的旧C流I/O或C ++ iostream,所以以前我没有对FILE_FLAG_NO_BUFFERING标志给予任何关注.

I wondering now, is it really important to consider unbuffered option in file I/O programming? Because many programs use plain old C stream I/O or C++ iostream, I didn't gave any attention to FILE_FLAG_NO_BUFFERING flag before.

假设我们正在开发Picasa之类的照片浏览器程序.如果我们实现无缓冲的I/O,缩略图显示速度是否可以在普通用户中显示出明显的差异?

Let's say we are developing photo explorer program like Picasa. If we implement unbuffered I/O, could thumbnail display speed show noticeable difference in ordinary users?

推荐答案

否,此标志不适用于典型的磁盘用户.它用于诸如数据库之类的程序,在这些程序中它们需要执行自己的文件缓存管理以实现最佳性能.虽然我确定您会发现它可以加快程序速度的情况,但在大多数情况下,您还是希望使用操作系统提供的缓冲功能,这就是它存在的原因.

No, this flag is not for typical disk users. It is for programs like databases where they need to perform their own file cache management for optimal performance. While I'm sure you could find situations where it would speed up your program, for the most part you would want to use the OS-provided buffering -- that's why it's there.

这篇关于使用FILE_FLAG_NO_BUFFERING会返回明显的速度增益吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆