-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 the number of RefCell
s in InferCtxt
.
#68694
Reduce the number of RefCell
s in InferCtxt
.
#68694
Conversation
Some local results (instruction counts):
@bors try @rust-timer queue |
Awaiting bors try build completion |
Reduce the number of `RefCell`s in `InferCtxt`. `InferCtxt` contains six structures within `RefCell`s. Every time we create and dispose of (commit or rollback) a snapshot we have to `borrow_mut` each one of them. This commit moves the six structures under a single `RefCell`, which gives significant speed-ups by reducing the number of `borrow_mut` calls. To avoid runtime errors I had to reduce the lifetimes of dynamic borrows in a couple of places. r? @varkor
☀️ Try build successful - checks-azure |
@rust-timer build 20d9fc0 |
Queued 20d9fc0 with parent 266ecd6, future comparison URL. |
Finished benchmarking try commit 20d9fc0, comparison URL. |
It's unfortuanate that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thanks! r=me after rebasing.
AFAICT no rebasing is required. @bors r=varkor |
📌 Commit cf1039f has been approved by |
Oops, there are conflicts. |
cf1039f
to
e183f82
Compare
I rebased. @bors r=varkor |
📌 Commit e183f82 has been approved by |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
…rCtxt, r=varkor Reduce the number of `RefCell`s in `InferCtxt`. `InferCtxt` contains six structures within `RefCell`s. Every time we create and dispose of (commit or rollback) a snapshot we have to `borrow_mut` each one of them. This commit moves the six structures under a single `RefCell`, which gives significant speed-ups by reducing the number of `borrow_mut` calls. To avoid runtime errors I had to reduce the lifetimes of dynamic borrows in a couple of places. r? @varkor
@bors r- |
`InferCtxt` contains six structures within `RefCell`s. Every time we create and dispose of (commit or rollback) a snapshot we have to `borrow_mut` each one of them. This commit moves the six structures under a single `RefCell`, which gives significant speed-ups by reducing the number of `borrow_mut` calls. To avoid runtime errors I had to reduce the lifetimes of dynamic borrows in a couple of places.
e183f82
to
7426853
Compare
Bah, I fell for the old git-push-with-uncommitted-changes trick. Let's try again. @bors r=varkor |
📌 Commit 7426853 has been approved by |
…rCtxt, r=varkor Reduce the number of `RefCell`s in `InferCtxt`. `InferCtxt` contains six structures within `RefCell`s. Every time we create and dispose of (commit or rollback) a snapshot we have to `borrow_mut` each one of them. This commit moves the six structures under a single `RefCell`, which gives significant speed-ups by reducing the number of `borrow_mut` calls. To avoid runtime errors I had to reduce the lifetimes of dynamic borrows in a couple of places. r? @varkor
@nnethercote Could we use a |
Rollup of 6 pull requests Successful merges: - #68694 (Reduce the number of `RefCell`s in `InferCtxt`.) - #68966 (Improve performance of coherence checks) - #68976 (Make `num::NonZeroX::new` an unstable `const fn`) - #68992 (Correctly parse `mut a @ b`) - #69005 (Small graphviz improvements for the new dataflow framework) - #69006 (parser: Keep current and previous tokens precisely) Failed merges: r? @ghost
I don't know anything about |
Oh, they're just hypothetical data structures which avoid the cost of a |
InferCtxt
contains six structures withinRefCell
s. Every time wecreate and dispose of (commit or rollback) a snapshot we have to
borrow_mut
each one of them.This commit moves the six structures under a single
RefCell
, whichgives significant speed-ups by reducing the number of
borrow_mut
calls. To avoid runtime errors I had to reduce the lifetimes of dynamic
borrows in a couple of places.
r? @varkor