numpy.memmap initializes with zeros (on systems with POSIX filesystem semantics).
Then how can it take only 0.3 seconds to fill a 10 GB file with zeros like this:
n = 10000000000
f = np.memmap('tmp.mmap', dtype='uint8', mode='w+', shape=(n, 1))
f[-1] = 1 # set some value
del f # flush changes
f = np.memmap('tmp.mmap', dtype='uint8', mode='r', shape=(n, 1))
Writing 10 GB to disk usually takes longer than 0.3 seconds.