You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current replace.RegexpTransformer offloads buffering to the calling code. It does this by repeatedly returning transform.ErrShortSrc until enough data is available. Even though this technically conforms to the documentation/contract, it fails when used with transform.Chain due to its internal (undocumented) 2kb buffering limit #5golang/go#49117.
The replace.Chain was added as an alternative to transform.Chain. However, each call to Chain allocates 8kb for each underlying transform.Reader. I've opened a proposal to add a transform.Reader.Reset method, but the author of x/text is unresponsive.
We can avoid all these problems by doing the buffering ourselves.
The text was updated successfully, but these errors were encountered:
The current
replace.RegexpTransformer
offloads buffering to the calling code. It does this by repeatedly returningtransform.ErrShortSrc
until enough data is available. Even though this technically conforms to the documentation/contract, it fails when used withtransform.Chain
due to its internal (undocumented) 2kb buffering limit #5 golang/go#49117.The replace.Chain was added as an alternative to
transform.Chain
. However, each call toChain
allocates 8kb for each underlyingtransform.Reader
. I've opened a proposal to add atransform.Reader.Reset
method, but the author ofx/text
is unresponsive.We can avoid all these problems by doing the buffering ourselves.
The text was updated successfully, but these errors were encountered: