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

Reduce amount of objects allocated by the codec #1000

Merged
merged 2 commits into from
Feb 23, 2016

Conversation

2opremio
Copy link
Contributor

Closes #972 . Improves #812 and #854

Results in the probe generating ~20% less objects. See ugorji/go#143

To reduce garbage from simpleIoEncWriterWriter
(ugorji/go#143)
@@ -24,7 +24,7 @@ RUN_FLAGS=-ti
BUILD_IN_CONTAINER=true
GO ?= env GO15VENDOREXPERIMENT=1 go
GO_BUILD_INSTALL_DEPS=-i
GO_BUILD_TAGS=-tags netgo
GO_BUILD_TAGS=-tags 'netgo unsafe'

This comment was marked as abuse.

This comment was marked as abuse.

@2opremio 2opremio force-pushed the reduce-codec-garbage branch from 6095c95 to 996062d Compare February 22, 2016 13:45
This was referenced Feb 22, 2016
@paulbellamy
Copy link
Contributor

As discussed in slack, the decoding thing will only affect gzip writers, which we might be able to solve with a bufio.Writer wrapping the gzip writer. the stringView one is a bit trickier. :|

@2opremio
Copy link
Contributor Author

Unfortunately ugorji/go#143 shows the biggest benefit when encoding. So ... should I revert it?

@2opremio
Copy link
Contributor Author

After thinking about it a bit more, we already obtain much higher performance from codecgen because we run it with -u, which generates code applying the same kind of tricks. So I don't think -tags unsafe makes the situation worse (and I certainly wouldn't consider using codecgen without -u for the reasons explained).

paulbellamy added a commit that referenced this pull request Feb 23, 2016
Reduce amount of objects allocated by the codec
@paulbellamy paulbellamy merged commit f24ebc9 into master Feb 23, 2016
@paulbellamy paulbellamy deleted the reduce-codec-garbage branch February 23, 2016 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants