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

proposal: x/text/transform: Add func (*Reader).Reset(r io.Reader, t Transformer) #55325

Open
icholy opened this issue Sep 21, 2022 · 3 comments
Labels
Milestone

Comments

@icholy
Copy link

icholy commented Sep 21, 2022

The x/test/transform.Reader constructor allocates two 4kb buffers. I want to reuse existing Readers with a sync.Pool to reduce allocations. I'm proposing a Reset method similar to bufio.Reader.Reset

func (rd *Reader) Reset(r io.Reader, t Transformer) {
	t.Reset()
	rd.r = r
	rd.t = t
	rd.err = nil
	rd.dst0 = 0
	rd.dst1 = 0
	rd.src0 = 0
	rd.src1 = 0
}
@ianlancetaylor
Copy link
Contributor

CC @mpvl

@icholy
Copy link
Author

icholy commented Nov 15, 2022

@ianlancetaylor is @mpvl still actively participating in this project? I appreciate that people are busy, but #49117 has been sitting for over a year. I'm wondering if we're waiting for someone who's never going to respond.

@ianlancetaylor
Copy link
Contributor

@mpvl still responds from time to time. But in any case this proposal is still in the incoming queue along with a couple of hundred other proposals. We aren't waiting for @mpvl, we're waiting for the proposal review committee.

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

No branches or pull requests

3 participants