-
Notifications
You must be signed in to change notification settings - Fork 19
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
Improve performance for high-channel count #34
Comments
Here's a useful context manager for timing section of code: import time
class Timer:
def __init__(self, *, label='', verbose=False):
self._label = label
self._start_time = None
self._stop_time = None
self._verbose = verbose
def elapsed(self):
if self._stop_time is None:
return time.time() - self._start_time
else:
return self._stop_time - self._start_time
def __enter__(self):
self._start_time = time.time()
return self
def __exit__(self, exc_type, exc_value, exc_tb):
self._stop_time = time.time()
if self._verbose:
print(f"Elapsed time time for {self._label}: {self.elapsed()} sec")
with Timer(label='sleep', verbose=True) as timer:
# some expensive operation
time.sleep(3)
print(timer.elapsed()) |
Run mountainsort4 on 18-ch recording, 10-60 minutes. And try to determine where the bottleneck is: This is the file you'll need to put thing timing tests: |
Different parts to time:
Also useful to know the scaling properties of the above steps (as channel number or duration increases) I suggest trying |
May also be helpful to see how timings scale with changes in adjacency_radius (nbhd size). |
No description provided.
The text was updated successfully, but these errors were encountered: