8000 BUG: only benchmark complex256 if it exists by matthew-brett · Pull Request #7251 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: only benchmark complex256 if it exists #7251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion benchmarks/benchmarks/bench_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

from .common import Benchmark, get_squares_, get_indexes_, get_indexes_rand_

from os.path import join as pjoin
import shutil
import sys
import six
from numpy import memmap, float32, array
import numpy as np
from tempfile import mkdtemp


class Indexing(Benchmark):
Expand Down Expand Up @@ -37,9 +40,15 @@ def time_op(self, indexes, sel, op):

class IndexingSeparate(Benchmark):
def setup(self):
self.fp = memmap('tmp.dat', dtype=float32, mode='w+', shape=(50, 60))
self.tmp_dir = mkdtemp()
self.fp = memmap(pjoin(self.tmp_dir, 'tmp.dat'),
dtype=float32, mode='w+', shape=(50, 60))
self.indexes = array([3, 4, 6, 10, 20])

def teardown(self):
del self.fp
shutil.rmtree(self.tmp_dir)

def time_mmap_slicing(self):
for i in range(1000):
self.fp[5:10]
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/benchmarks/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
'int32', 'float32',
'int64', 'float64', 'complex64',
'longfloat', 'complex128',
'complex256',
]
if 'complex256' in numpy.typeDict:
TYPES1.append('complex256')


def memoize(func):
Expand Down
0