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

Turn off runtime assertions, turn on runtime optimizations #2589

Closed
brson opened this issue Jun 14, 2012 · 2 comments
Closed

Turn off runtime assertions, turn on runtime optimizations #2589

brson opened this issue Jun 14, 2012 · 2 comments
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@brson
Copy link
Contributor

brson commented Jun 14, 2012

The runtime has several performance-sensitive code paths that are compromising between going fast and making important assertions.

Right now the runtime knows about RUST_DEBUG and RUST_NDEBUG macros. When RUST_DEBUG is defined we do assertions about lock ownership and not much else. RUST_NDEBUG is defined by default, not RUST_DEBUG.

Let's make greater use of this by disabling expensive assertions and enabling optimizations. Because this involves disabling a lot of very checks we'll have RUST_DEBUG on by default.

Without RUST_DEBUG we can

  • Run the box annihilator on normal task exit without worrying about obscuring cycle collector errors
  • Turn off valgrind hints on stack allocation and switching paths that have real overhead
  • Turn off check_stack_canary
  • Turn off other expensive asserts

By default (with RUST_DEBUG) you get

  • More locking assertions
  • More calls to check_stack_canary
  • More expensive asserts on the stack switching fast paths

Most likely this will involve changing the configure script too. Instead of --enable-debug we would have --disable-debug. Since this should end up with a noticeable performance difference between the two, configure and/or make all and make check might want to mention it, perhaps even in a handsome ascii-art box.

Notes

@ghost ghost assigned brson Jun 14, 2012
@huonw
Copy link
Member

huonw commented Aug 5, 2013

Triage 2013-08-05: I have a feeling that this is a WONTFIX, since the oldrt is disappearing (very?) soon. Is this correct @brson?

(Although this issue probably also applies to the newrt, e.g. for building with/without --cfg debug.)

@brson
Copy link
Contributor Author

brson commented Oct 11, 2013

Obsolete.

@brson brson closed this as completed Oct 11, 2013
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Rewrite the reachability module to use Stable APIs wherever possible.
Note that in StableMIR the instance body is already monomorphized and
constants are already evaluated, which simplifies the code for most of
it, except to handle stubbing issue rust-lang#2589.

For the stubbing issue, we still use a mix of stable and internal APIs
to detect an invalid monomorphization.

Co-authored-by: Adrian Palacios <73246657+adpaco-aws@users.noreply.github.com>
Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

2 participants