.NET 4.0内存映射文件的性能 [英] .NET 4.0 Memory Mapped Files Performance

查看:212
本文介绍了.NET 4.0内存映射文件的性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有人尝试新的.NET 4.0内存映射文件的功能? 我知道他们是一样古老的操作系统,但本地处理的.NET是新的。

I'd like to know if anyone tried new .NET 4.0 Memory Mapped Files features? I know that they are as old as OS but native handling in .NET is new.

有没有人能够测试该说些什么表现? 我在访问时间为二进制文件,写入速度等随机配件很感兴趣。同样表现comparsion为本地WinAPI的MMF将是很好的。

Has anyone been able to test this and say something about performance? I'm quite interested in access time to random parts of binary file, write speed and so on. Also performance comparsion to native WinAPI MMF would be nice.

谢谢!

推荐答案

在.NET 4.0(在新 System.IO.MemoryMappedFiles 命名空间)内存映射文件简单地包裹在Win32 API的内存映射文件。

Memory mapped files in .NET 4.0 (in the new System.IO.MemoryMappedFiles namespace) simply wrap the Win32 API for memory mapped files.

这意味着他们以最快的速度是可能的。这是用来加载.NET程序到内存中相同的机制。

That means they are as fast as is possible. This is the same mechanism that is used to load .NET assemblies into memory.

在实际的时间数量而言,这将取决于32位与64位,您有多少内存,文件有多大,访问模式(S),并在很大程度上物理磁盘硬件的类型。

In terms of actual timing numbers, this will depend on 32bit versus 64bit, how much memory you have, how large the files are, the access pattern(s) and to a large extent the type of physical disk hardware.

参考:内存映射文件

这篇关于.NET 4.0内存映射文件的性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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