C# 获取文件的复杂性
我正在考虑将大量文件存储在一个文件夹中并将它们加载到我的 C# 程序中。我考虑的问题是从包含很多文件的文件夹加载要读取的文件时的性能。当所选文件夹中有一个文件或一百万个文件时,加载和读取文件的时间是否大致相同?有谁知道复杂性吗? (O(1)、O(n)、O(n^2)?)
Im thinking of storing a large number of files in a folder and load them into my C# program. The problem I thought about was the performance when loading a file to read from, from a folder that contains very many files. Will the time to load and read from a file be about the same when there is one file in the chosen folder or one million? Does anyone know the complexity? ( O(1), O(n), O(n^2)? )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果你只选择了一个文件,那么如果有一个或一百万个文件,只要你选择正确的路径,它就不会。
如果您尝试读取所有文件,然后从中进行搜索,那么情况会有所不同:P
但如果您有确切的文件路径,则没有区别
If you are only selected one file, it does not if there is one or a million files, as long as you pick the path correctly.
If you are trying to read all the files,and then search from that, then that is different :P
but if you have the exact file path to it, then no difference