Skip to content
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

Preallocate the read buffer for numerical data #46

Merged
merged 2 commits into from
Oct 7, 2019
Merged

Preallocate the read buffer for numerical data #46

merged 2 commits into from
Oct 7, 2019

Conversation

tstenner
Copy link
Contributor

@tstenner tstenner commented Oct 4, 2019

For numerical chunks, each sample has a constant size, so this change allocates and reuses a read buffer to avoid one allocation per sample. With a large sample file (64 double channels, 1M samples) the total runtime decreases by 11% and the context switches by 98%.

@cbrnr
Copy link
Contributor

cbrnr commented Oct 4, 2019

Nice change!

@cbrnr
Copy link
Contributor

cbrnr commented Oct 4, 2019

Can you add a CHANGELOG entry?

@tstenner
Copy link
Contributor Author

tstenner commented Oct 4, 2019

Done.

@cbrnr cbrnr merged commit 444fd49 into master Oct 7, 2019
@cbrnr cbrnr deleted the prealloc branch October 7, 2019 09:09
@cbrnr
Copy link
Contributor

cbrnr commented Oct 7, 2019

Thanks @tstenner!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants