-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Turn off runtime assertions, turn on runtime optimizations #2589
Copy link
Copy link
Closed
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsI-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.
Metadata
Metadata
Assignees
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsI-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
By default (with RUST_DEBUG) you get
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,
configureand/ormake allandmake checkmight want to mention it, perhaps even in a handsome ascii-art box.