Skip to content

Commit

Permalink
increase work in trace to show improvement despite unboxing overhead
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Jun 9, 2022
1 parent 9035999 commit db29182
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/test_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@ def go_fast(a, d):
trace += d.fField
return a + trace

x = np.arange(100, dtype=np.float64).reshape(10, 10)
# note: need a sizable array to outperform given the unboxing overhead
x = np.arange(10000, dtype=np.float64).reshape(100, 100)
d = cppyy.gbl.MyNumbaData1(42)

assert((go_fast(x, d) == go_slow(x, d)).all())
# TODO: currently, unboxing is too much of slow-down :(
#assert self.compare(go_slow, go_fast, 100000, x, d)
#assert self.compare(go_slow, go_fast, 10000, x, d)

def test04_proxy_argument_for_method(self):
"""Numba-JITing of a free function taking a proxy argument for method access"""
Expand Down Expand Up @@ -198,10 +198,10 @@ def go_fast(a, d):
trace += d.get_field()
return a + trace

x = np.arange(100, dtype=np.float64).reshape(10, 10)
# note: need a sizable array to outperform given the unboxing overhead
x = np.arange(10000, dtype=np.float64).reshape(100, 100)
d = cppyy.gbl.MyNumbaData2(42)

assert((go_fast(x, d) == go_slow(x, d)).all())
# TODO: currently, unboxing is too much of slow-down :(
#assert self.compare(go_slow, go_fast, 100000, x, d)
assert self.compare(go_slow, go_fast, 10000, x, d)

0 comments on commit db29182

Please sign in to comment.