-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Performance enhancements for RangesIO.
RangesIO is critical to performance of ruby-ole, and has finally received some attention. Short of adding a buffered stream on top, the performance isn't going to improve much. Fixes include: 1. Precalculate cumulative offsets and use binary search for finding appropriate range when seeking. 2. Previously every read did a range search. Now we store and maintain a pointer to the active range when seeking, and simply increment when a read/write spills over to the next. 3. Avoid costly creation of large temporary arrays storing range list for read/write ops. 4. On top of all the above, include range combining, so that in the bulk of cases, theres not too many distinct ranges to consider, despite typical block size of 512 bytes. git-svn-id: https://ruby-ole.googlecode.com/svn/trunk@67 f297d60c-f930-0410-b1c6-9ffd80c20a0c
- Loading branch information
Showing
4 changed files
with
88 additions
and
69 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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