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

Core: Refactor parser to use bufferedReadSeeker type #55

Open
gunnsth opened this issue Apr 24, 2019 · 0 comments
Open

Core: Refactor parser to use bufferedReadSeeker type #55

gunnsth opened this issue Apr 24, 2019 · 0 comments
Labels
enhancement New feature or request major Major changes requiring major version upgrades performance

Comments

@gunnsth
Copy link
Contributor

gunnsth commented Apr 24, 2019

Based on discussion in #441. The proposal is to create a buffered reader type which encapsulates a ReadSeeker and a buffered Reder (bufio.Reader). Rather than accessing and working with both separately.

The suggested type is something as follows:

// bufferedReadSeeker offers buffered read access to a seekable source (such as a file) with seek capabilities.
type bufferedReadSeeker struct {
rs io.ReadSeeker
reader *bufio.Reader
}
// Implement the Read and Seek methods.

The reason for using the bufio.Reader is purely based on performance during parsing as it has a buffer. Any time we change the offset position of rs a new reader must be constructed with a new buffer (and use the buffered information to correct for offsets as done in parser.GetPosition).

@gunnsth gunnsth transferred this issue from unidoc/unidoc May 24, 2019
@gunnsth gunnsth added major Major changes requiring major version upgrades performance enhancement New feature or request labels Jun 2, 2020
@gunnsth gunnsth unassigned adrg Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request major Major changes requiring major version upgrades performance
Projects
None yet
Development

No branches or pull requests

2 participants