Python randomly drops to 0% CPU usage, causing the code to “hang up”, when handling large numpy arrays?

前端 未结 3 1789
隐瞒了意图╮
隐瞒了意图╮ 2021-01-12 17:04

I have been running some code, a part of which loads in a large 1D numpy array from a binary file, and then alters the array using the numpy.where() method.

Here is

3条回答
  •  暖寄归人
    2021-01-12 17:04

    The drops in CPU usage were unrelated to python or numpy, but were indeed a result of reading from a shared disk, and network I/O was the real culprit. For such large arrays, reading into memory can be a major bottleneck.

提交回复
热议问题