ENH: Speed up reading of small buffers#12343
Merged
drammock merged 6 commits intomne-tools:mainfrom Jan 10, 2024
Merged
Conversation
drammock
reviewed
Jan 9, 2024
larsoner
commented
Jan 10, 2024
| lines = show_fiff(str(bad_fname), output=list) | ||
| last_line = lines[-1] | ||
| assert ">>>>BAD" in last_line | ||
| assert "302 = FIFF_EPOCH (734412b >f4)" in last_line |
Member
Author
There was a problem hiding this comment.
Nice catch on the order above @drammock, this line used to be:
302 = FIFF_EPOCH (734412b ?1073741828?) >>>>>>>>>>>>>>>>>>>>BAD'
which is wrong, now it's correct:
302 = FIFF_EPOCH (734412b >f4) >>>>>>>>>>>>>>>>>>>>BAD
drammock
approved these changes
Jan 10, 2024
snwnde
pushed a commit
to snwnde/mne-python
that referenced
this pull request
Mar 20, 2024
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12234
@britta-wstnr at the end of the day I don't think the
numpy.dtypeI considered in #12234 will be tractable/worth it as:buffer_size_sec=1., then the I/O is no longer slowOkay with you to close the associated issue when this is merged?
In the meantime this PR cleans up and speeds up our tag code, on my system it:
pytest mne/io/fifffrom23.79sto20.46sTaglogic and functions, especially involving when tofid.seekto a new position in a file (it's explicit now rather than implicit)copy_treewhich is already in a private namespace (mne._fiff) so no need to deprecate, can just removefid.tellbecause this function was surprisingly a source of slowdowns in the single-sample buffer case