Skip to content

pool flate writers#194

Merged
1 commit merged intogorilla:masterfrom
y3llowcake:flate_pool
Dec 17, 2016
Merged

pool flate writers#194
1 commit merged intogorilla:masterfrom
y3llowcake:flate_pool

Conversation

@y3llowcake
Copy link
Copy Markdown
Contributor

No description provided.

@y3llowcake
Copy link
Copy Markdown
Contributor Author

Hoping this is relatively uncontroversial, in theory it should only improve on existing performance characteristics.

Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add test for w.fw == nil in Write method.

w.fw = nil
}()
err1 := w.fw.Flush()
if w.tw.p != [4]byte{0, 0, 0xff, 0xff} {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the defer and add the following after Flush()

 flatWritePool.Put(w.fw)
 w.fw = nil

compression.go Outdated

func (w *flateWrapper) Close() error {
if w.fw == nil {
return errors.New("already closed")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return errWriteClosed.

@y3llowcake
Copy link
Copy Markdown
Contributor Author

Done

@ghost
Copy link
Copy Markdown

ghost commented Dec 16, 2016

Does not compile.

@y3llowcake
Copy link
Copy Markdown
Contributor Author

Sorry, I'm terrible with computers. This should be fixed now.

@ghost ghost merged commit 3ab3a8b into gorilla:master Dec 17, 2016
@ghost ghost locked and limited conversation to collaborators Feb 14, 2018
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant