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

Remove Expensive log.Debuf(...) statement in blockstore.AllKeysChan? #3378

Closed
kevina opened this issue Nov 14, 2016 · 1 comment
Closed

Remove Expensive log.Debuf(...) statement in blockstore.AllKeysChan? #3378

kevina opened this issue Nov 14, 2016 · 1 comment
Assignees
Labels
topic/perf Performance

Comments

@kevina
Copy link
Contributor

kevina commented Nov 14, 2016

This statement is causing a major slowdown in AllKeysChan,

	get := func() (*cid.Cid, bool) {
		...
		log.Debug("blockstore: query got key", c)
		...
	}

due to the fact that the Cid is converted to a string which is very expensive due to the conversion to the Base58 representation. This is done even if the log.Debug does not output anything. See #3376.

The question is what to do about it? The easiest thing would be to just remove it or comment it out with a explanation to why.

The other alternative is to only enable it when Debug mode is activated, but this is not the same as the Debug logging level.

I can't seam to find a way to check what the logging level is, if there was I could just use that.

@whyrusleeping
Copy link
Member

@kevina I think its fair to remove that one. Its not really necessary here, and isnt a log statement i've ever found useful in debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/perf Performance
Projects
None yet
Development

No branches or pull requests

2 participants