如何快速加载更大尺寸(1GB)的文件? [英] How to load files of greater sizes (1GB) quickly?

查看:146
本文介绍了如何快速加载更大尺寸(1GB)的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在编写一个查看器MFC应用程序,它将解析输入文件(bin文件)并显示其内容.我已经使用mysql来存储和检索记录.当我使用小文件(1 MB)处理大文件(> 100MB)时,可以加载太多时间.你们能给我一些想法,以便我快速读取和加载文件可能不到一分钟.

谢谢,

Hi All,

I am writing a viewer MFC application, which will parse the input file (a bin file) and display its contents. I have used mysql to store and retrieve records. Its ok when i am working with small file (1 MB) for big files (>100MB) it is taking too much time to load. Can you guys give me some ideas so that I can read and load the files quickly may be less than a minute.

Thanks,

推荐答案

是否尝试过完全不加载,而是使用CMemMapFile [ ^ ]代替?因为它使用OS分页机制,所以它的速度最快.
Have you tried not loading it at all, but using a CMemMapFile[^] instead? That''s about as fast as it can get since it uses the OS paging mechanism.


诀窍是仅加载所需的部分.例如,用户一次只能看到整个文件内容的一小部分,您应该利用这一事实仅加载所需的数据部分.
The trick is loading only the needed part. For instance, the user can just see a small part of the whole file content at time, you should exploit this fact to load only the required portion of data.


这篇关于如何快速加载更大尺寸(1GB)的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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