-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add a DroplessArena and utilize it as a more efficient arena when possible #38653
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
Conversation
} | ||
} | ||
} | ||
|
||
pub struct CtxtInterners<'tcx> { | ||
/// The arenas that types etc are allocated from. |
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.
No need to remove the comment, just make it singular.
@@ -387,6 +369,7 @@ impl<'a, 'gcx, 'tcx> Deref for TyCtxt<'a, 'gcx, 'tcx> { | |||
} | |||
|
|||
pub struct GlobalCtxt<'tcx> { | |||
global_arenas: &'tcx CtxtArenas<'tcx>, |
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.
A rename to GlobalArenas
might make more sense. In fact, a GlobalInterners
type would help too, I think layout
isn't the only one, and stability
also is global-only.
@@ -4560,9 +4561,9 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { | |||
/// Report errors if the provided parameters are too few or too many. | |||
fn check_path_parameter_count(&self, | |||
span: Span, | |||
segment: &mut Option<(&hir::PathSegment, &ty::Generics)>) { | |||
segment: &mut Option<(&hir::PathSegment, Rc<ty::Generics>)>) { |
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.
Maybe you shouldn't change anything about ty::Generics
, if you can avoid it (since we're keeping at least some of the typed drop-ful arenas for now).
It relies on the underlying types not having special Drop behavior.
c6f8cfb
to
ace23f1
Compare
CtxtInterners contains a single DroplessArena, while GlobalArenas contains the TypedArenas still required for the remaining Drop-containing types.
ace23f1
to
1676bec
Compare
|
||
stability_interner: RefCell<FxHashSet<&'tcx attr::Stability>>, | ||
|
||
layout_interner: RefCell<FxHashSet<&'tcx Layout>>, |
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.
My main concern now might be grouping these in a GlobalInterners
type.
@bors r+ |
📌 Commit 1676bec has been approved by |
Leaving this here in case anyone has any ideas: https://gist.githubusercontent.com/Mark-Simulacrum/6a088a61f8eff2c2ded205432b4b5de9/raw/982f7329e4ac5c2c8aec57fbccf20257b8a350de/gistfile1.txt. This is a list of the However, no meaningful optimizations based on this have been thought of quite yet. |
⌛ Testing commit 1676bec with merge ca4a0b1... |
💔 Test failed - status-travis |
@bors: retry
* osx linker segfaulted
…On Sat, Dec 31, 2016 at 2:08 PM, bors ***@***.***> wrote:
💔 Test failed - status-travis
<https://travis-ci.org/rust-lang/rust/builds/187951270>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#38653 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95PGVU473c94j8FKuu0DWGHbz_IBfks5rNtJNgaJpZM4LW-Oo>
.
|
Add a DroplessArena and utilize it as a more efficient arena when possible I will collect performance (probably just `-Ztime-passes`, and more if that shows significant differences, perhaps). 6feba98 also fixes a potential infinite loop if inplace reallocation failed for `TypedArena` (and `DroplessArena` via copied code). r? @eddyb
☀️ Test successful - status-appveyor, status-travis |
I will collect performance (probably just
-Ztime-passes
, and more if that shows significant differences, perhaps).6feba98 also fixes a potential infinite loop if inplace reallocation failed for
TypedArena
(andDroplessArena
via copied code).r? @eddyb