8000 ENH: avoid temporary arrays in expressions (again) by juliantaylor · Pull Request #7997 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: avoid temporary arrays in expressions (again) #7997

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 3 commits into from
Feb 25, 2017
Merged
Changes from 1 commit
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
Prev Previous commit
BENCH: add benchmarks for operations with temporaries
  • Loading branch information
juliantaylor committed Feb 24, 2017
commit c3e24b2f2860ce1912f578cf996184198a3cfd25
20 changes: 20 additions & 0 deletions benchmarks/benchmarks/bench_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,26 @@ def time_tril_l10x10(self):
np.tril(self.l10x10)


class Temporaries(Benchmark):
def setup(self):
self.amid = np.ones(50000)
self.bmid = np.ones(50000)
self.alarge = np.ones(1000000)
self.blarge = np.ones(1000000)

def time_mid(self):
(self.amid * 2) + self.bmid

def time_mid2(self):
(self.amid + self.bmid) - 2

def time_large(self):
(self.alarge * 2) + self.blarge

def time_large2(self):
(self.alarge + self.blarge) - 2


class MA(Benchmark):
def setup(self):
self.l100 = range(100)
Expand Down
0