更强大的CPU读取文件是否更快(例如:A CSV?)
哪些方面(也不)影响计算机可以读取文件的速度?例如,python阅读CSV。
我猜芯没关系。我猜甚至线程都没关系。但是也许GHz很重要?
What aspects do (and do not) effect the speed at which a computer can read files? Say for example, Python reading a CSV.
I am guessing cores do not matter. I am guessing even threads don't matter. But perhaps the ghz matter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这取决于限制读取操作的是什么。
大多数东西是I/O绑定或CPU绑定。
基本上:如果CPU给出了获取数据并将其移动的说明,但是数据必须来自网络或(慢速)磁盘,则更快的CPU无济于事,因为该程序(和CPU)大部分都花费大部分它的时间等待数据到达。
另一方面,如果程序本身给予了CPU的工作量如此之多,以至于CPU无法跟上CPU,那么更快的CPU会加快速度。
That depends on what's limiting the read operation.
Most things are either I/O bound or CPU bound.
Basically: If the CPU is giving instructions to fetch data and move it around, but the data has to come from the network or a (slow) disk, a faster CPU won't help as the program (and the CPU) spends most of its time waiting for data to arrive.
If, on the other hand, the program itself gives the CPU so much work that a slow CPU can't keep up, then a faster CPU does speed things up.
或许?
我们缺少太多信息无法得出结论。对于大文件,您可能会受到解析过程中最慢的步骤的约束。这可能是从磁盘上读取,访问RAM,在CPU上解析原始数据或其他大量内容。核心的数量可能很重要。不知道如何实现CSV解析器,我们无法确定。也许它将CSV分解成块,因此可以通过多个内核来解析。
最重要的是,如果您想要一个确定的答案,则需要介绍有关您有疑问的应用程序。我们可以根据需要做出尽可能多的猜测,但是在一天结束时,该程序是肯定知道的唯一方法。
Maybe?
We are missing too much information to reach a conclusion. For a large file, you will likely be constrained by the slowest step in the parsing process. That could be reading from the disk, accessing RAM, parsing the raw data on the CPU or a large number of other things. The number of cores might matter. Without knowing how the CSV parser is implemented, we can't be sure though. Maybe it breaks the CSV into chunks so it can be parsed by multiple cores.
The bottom line is if you want a definite answer you need to profile the application you have questions about. We can make as many guesses as we want, but at the end of the day profiling the program is the only way to know for sure.