-
Notifications
You must be signed in to change notification settings - Fork 240
Make binary recording memmap efficient #1741
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
Make binary recording memmap efficient #1741
Conversation
| channel_indices: Union[List, None] = None, | ||
| ) -> np.ndarray: | ||
| traces = self._timeseries[start_frame:end_frame] | ||
| data = np.memmap(self.datfile, self.dtype, mode="r", offset=self.file_offset, shape=self.shape) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ramon.
We should use the same trick as in neo. Open the file in init an d create the memmap on the fly.
open/close on network drive has a cost!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the two of them but I wanted to make smaller PRs:
|
I don't understand why opening the memmap on Opening and closing comes at a cost, but once opened it should only be a pointer to the file? |
|
@DradeAW |
Interesting, I always thought that calling Thank you :) |
|
You can read here why there is no unified interface: |
|
I am thinking on writing a blogpost about it but June is a very busy time for contracts. Maybe next month. |
|
I propose to close this and merge #1742 instead. |
|
Fine by me, I added the close flag on the other PR. |
In the context of #1602 and NeuralEnsemble/python-neo#1265.
This does not go all the way to use native python buffers which is what we have done in those PR but it moves closer in that direction. I added a further test.