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

RFC: Add a mode to not generate debug! statements, use by default for core/std #4397

Closed
pcwalton opened this issue Jan 9, 2013 · 6 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@pcwalton
Copy link
Contributor

pcwalton commented Jan 9, 2013

I just looked at the source for any pipes code and a huge amount of debug! stuff in the pipes code is getting monomorphized, inlined, and written into every single send and recv in all user code. I propose disabling generation of debug! by default; it's purely a hazard for core and std.

@nikomatsakis
Copy link
Contributor

This seems sensible. I have sometimes wondered whether removing debug! makes any difference in the performance of rustc, as well. I would hate to have to remove them by hand---I personally prefer debug! statements to comments as a way of documenting what's happening. It means that when a bug occurs I can turn them on and follow along.

@catamorphism
Copy link
Contributor

Seems reasonable to me.

@bstrie
Copy link
Contributor

bstrie commented May 6, 2013

Nominating for Maturity 5.

@graydon
Copy link
Contributor

graydon commented May 9, 2013

subset of #3309, declining

@emberian
Copy link
Member

emberian commented Jul 1, 2013

I "disabled" this once by having debug!() expand into nothing, and it was a ~second speedup for rustc when RUST_LOG isn't set. It's just an extra branch for every debug! iirc.

This is fairly easy, check for some sort of argument, like --debug off, and use a different core-macros that has an empty expansion of debug!. Hacky, but effective. Could also do it for the other logging levels, though not as useful.

@huonw
Copy link
Member

huonw commented Jul 26, 2013

Implemented in b48e37e.

@huonw huonw closed this as completed Jul 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

7 participants