diff --git a/benchmarks/julia1_nopil.py b/benchmarks/julia1_nopil.py index cf9b20e7f..d95b584ab 100644 --- a/benchmarks/julia1_nopil.py +++ b/benchmarks/julia1_nopil.py @@ -69,9 +69,9 @@ def calc_pure_python(desired_width, max_iterations): cs.append(complex(c_real, c_imag)) print("Length of x:", len(x)) print("Total elements:", len(zs)) - start_time = time.time() + start_time = time.process_time() output = calculate_z_serial_purepython(max_iterations, zs, cs) - end_time = time.time() + end_time = time.process_time() secs = end_time - start_time sys.stdout.flush() sys.stderr.flush() diff --git a/heaplayers-make.mk b/heaplayers-make.mk index f05a8a7df..986121ae5 100644 --- a/heaplayers-make.mk +++ b/heaplayers-make.mk @@ -1,5 +1,5 @@ -# CPPFLAGS = -std=c++17 -flto -g -fno-builtin-malloc -O3 -DNDEBUG -fvisibility=hidden -CPPFLAGS = -std=c++17 -g -O3 -DNDEBUG -fno-builtin-malloc -fvisibility=hidden +CPPFLAGS = -std=c++17 -g -O3 -flto -DNDEBUG -fno-builtin-malloc -fvisibility=hidden +# CPPFLAGS = -std=c++17 -g -O3 -fno-builtin-malloc -fvisibility=hidden CXX = clang++ INCLUDES = -I. -I./include -IHeap-Layers -IHeap-Layers/wrappers -IHeap-Layers/utility diff --git a/scalene/old/reservoir.py b/scalene/old/reservoir.py deleted file mode 100644 index 4057d3aa6..000000000 --- a/scalene/old/reservoir.py +++ /dev/null @@ -1,32 +0,0 @@ -import math -import random - -class reservoir(): - """Implements reservoir sampling to achieve the effect of a uniform random sample.""" - - sample_array = [] - total_samples = 0 - max_samples = 0 - next_random_choice = 1 - - def __init__(self, size=0): - self.max_samples = size - self.total_samples = 0 - self.sample_array = [] - - def add(self, value): - self.total_samples += 1 - if self.total_samples <= self.max_samples: - self.sample_array.append(value) - else: - assert self.max_samples == len(self.sample_array) - self.next_random_choice -= 1 - #p = random.randint(0, self.total_samples - 1) - if self.next_random_choice <= 0: # p < self.max_samples: - # self.sample_array[p] = value - self.sample_array[random.randint(0, self.max_samples - 1)] = value - self.next_random_choice = round(random.expovariate(self.max_samples / self.total_samples), 0) - - def get(self): - return self.sample_array - diff --git a/test/testme.py b/test/testme.py index b99adbb45..cd6babb24 100644 --- a/test/testme.py +++ b/test/testme.py @@ -47,6 +47,7 @@ def stuff(): y = np.random.randint(1, 100, size=5000000)[4999999] x = 1.01 for i in range(1,10): + print(i) for j in range(1,10): x = doit1(x) x = doit2(x) @@ -54,5 +55,8 @@ def stuff(): x = 1.01 return x +import sys +print("TESTME") +print(sys.argv) stuff()