Vbench performance benchmarks for NumPy

vb_indexing

a[:,indexes_]

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[:,indexes_]

Performance graph

_images/a___indexes__.png

a[:,indexes_]=1

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[:,indexes_]=1

Performance graph

_images/a___indexes__=1.png

a[:,indexes_rand_]

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[:,indexes_rand_]

Performance graph

_images/a___indexes_rand__.png

a[:,indexes_rand_]=1

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[:,indexes_rand_]=1

Performance graph

_images/a___indexes_rand__=1.png

a[indexes_]

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[indexes_]

Performance graph

_images/a_indexes__.png

a[indexes_]=1

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[indexes_]=1

Performance graph

_images/a_indexes__=1.png

a[indexes_rand_]

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[indexes_rand_]

Performance graph

_images/a_indexes_rand__.png

a[indexes_rand_]=1

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[indexes_rand_]=1

Performance graph

_images/a_indexes_rand__=1.png

a[np.ix_(indexes_, indexes_)]

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[np.ix_(indexes_, indexes_)]

Performance graph

_images/a_np.ix__indexes___indexes___.png

a[np.ix_(indexes_, indexes_)]=1

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[np.ix_(indexes_, indexes_)]=1

Performance graph

_images/a_np.ix__indexes___indexes___=1.png

a[np.ix_(indexes_rand_, indexes_rand_)]

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[np.ix_(indexes_rand_, indexes_rand_)]

Performance graph

_images/a_np.ix__indexes_rand___indexes_rand___.png

a[np.ix_(indexes_rand_, indexes_rand_)]=1

Benchmark setup

from numpy_vb_common import *

Benchmark statement

for a in squares_.itervalues(): a[np.ix_(indexes_rand_, indexes_rand_)]=1

Performance graph

_images/a_np.ix__indexes_rand___indexes_rand___=1.png

mmap_fancy_indexing

Benchmark setup

import tempfile
from numpy import memmap, float32, array
fp = memmap(tempfile.NamedTemporaryFile(), dtype=float32, mode='w+', shape=(50,60))
indexes = array([3,4,6,10,20])

Benchmark statement

for i in range(1000):
     fp[indexes]

Performance graph

_images/mmap_fancy_indexing.png

mmap_slicing

Benchmark setup

import tempfile
from numpy import memmap, float32, array
fp = memmap(tempfile.NamedTemporaryFile(), dtype=float32, mode='w+', shape=(50,60))

Benchmark statement

for i in range(1000):
     fp[5:10]

Performance graph

_images/mmap_slicing.png