Make static file reading (content/metadata) operations sync #153
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.
Description
This PR makes file content and metadata read operations sync which increases performance and reduces resource utilization.
Synopsis
We know that the throughput is critical for file reading (content/metadata) operations on our static file module.
However, those particular operations were performed async, causing significant overhead due to the added extra costs of using the async runtime for them.
But, we have extremely little waiting (we essentially block on one task) for those file reading operations.
so we turned them into their sync counterparts, resulting in
~58%performance increase and~10%(CPU) /~52%(RAM) less resource utilization.Notes
We are now using a static
4KB(read buffer size) for Unix-like since looks like the number is still the most common page size for most operating systems.For Windows, we still keep the usage of
8KBsince it looks like it's a balanced number.We were inspired by the ideas of the weihanglo/sfz's
FileStreamimplementation as analogous to ourfile_streamone.Related Issue
Resolves #146
Motivation and Context
How Has This Been Tested?
Below are two 1min tests using the SWS defaults:
before (v2.13.0):
after:
Screenshots (if appropriate):
No