扫描硬盘 [英] Scanning hard drive

查看:63
本文介绍了扫描硬盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在编写一个应用程序来扫描硬盘并记录信息

关于驱动器上的每个罚款。


我的代码的第一次迭代使用了一个类和一个通用列表

来存储数据,而这需要在我的60 GB驱动器上花费13分钟。


我希望它更快。


所以我第二次将类更改为结构并仍然使用通用列表获得时间
差不多4分钟。


我想知道我是否可以进一步改善这个?


任何人都知道是否可以使用C#改进这个

还是需要在汇编程序等中进行改写?


rotsey

Hi,

I am writing an app that scans hard drives and logs info
about every fine on the drive.

The first iteration of my code used a class and a generic list
to store the data and rhis took 13min on my 60 GB drive.

I wanted it to be quicker.

So the second time I changed the class to a struct and still
with the generic list got the time down to 4 min.

I am wondering if I can improve on this even more??

Anyone know if it would be possible to improve this
using C# or would it need to be wrritten in assembler or the like?

rotsey

推荐答案

这完全取决于你如何编写代码! 13或4

分钟听起来很大 - 有多少数据?

It depends entirely on how you are doing the writing code! 13 or 4
mins sounds big - how much data?


" Rotsey" < ma *********** @ RemoveThis.optusnet.com.auwrote in message

news:er ************** @ TK2MSFTNGP05.phx.gbl ...
"Rotsey" <ma***********@RemoveThis.optusnet.com.auwrote in message
news:er**************@TK2MSFTNGP05.phx.gbl...




我正在编写一个扫描硬盘和日志信息的应用程序

关于驱动器上的每一个罚款。


我的代码的第一次迭代使用了一个类和一个通用列表

来存储数据和rhis在我的60 GB驱动器上花费了13分钟。


我希望它更快。
Hi,

I am writing an app that scans hard drives and logs info
about every fine on the drive.

The first iteration of my code used a class and a generic list
to store the data and rhis took 13min on my 60 GB drive.

I wanted it to be quicker.



多少钱,你的期望是什么?运行时间取决于

的文件夹和文件数以及您在

列表中存储的信息量。

How much, what are your expectations? The running time will depend on the
number of folders and files and the amount of info you are storing in the
list.


所以我第二次将类更改为结构,并且仍然使用通用列表将
的时间缩短到4分钟。
So the second time I changed the class to a struct and still
with the generic list got the time down to 4 min.



这是正常的,fileinfo在最后一次运行

时缓存在文件系统缓存中,这大大降低了文件系统IO速率以获取文件

信息。

This is normal, the "fileinfo" was cached in the filesystem cache with the
last run, this highly reduces the Filesystem IO rate to get at the file
information.


我想知道我是否可以对此进行更多改进?
I am wondering if I can improve on this even more??



我的猜测是你的系统开始分页因为你正在筋疲力尽br />
列表中数据的可用RAM空间。因此,您需要开始查看内存消耗,并更改您的设计,例如通过序列化每个扫描目录的列表作为磁盘上的文件。

My guess is that your system starts paging because you are exhausting the
Free RAM space with the data in your list. So, you need to start looking at
your memory consumption, and change your design, for instance by serializing
the List as a File on disk per directory you have scanned.


任何人都知道是否可以使用C#改进这个

,还是需要在汇编程序中进行写入?
Anyone know if it would be possible to improve this
using C# or would it need to be wrritten in assembler or the like?



不,这与语言无关,真的。

Willy。

No, this has nothing to do with the language, really.
Willy.


完全取决于你如何编写代码! 13或4
It depends entirely on how you are doing the writing code! 13 or 4

分钟听起来很大 - 有多少数据?
mins sounds big - how much data?



忽略;我误读了这个问题

Ignore; I misread the question


这篇关于扫描硬盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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