-
Notifications
You must be signed in to change notification settings - Fork 479
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
Interned all strings. #6011
base: dev-v2.7.0
Are you sure you want to change the base?
Interned all strings. #6011
Conversation
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.
Reviewable status: 0 of 124 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware, @ilyalesokhin-starkware, and @orizi)
a discussion (no related file):
This change sounds like it will create a massive memory leak-style behaviour, especially in the LS. Salsa has no means for garbage collection for interned items (LRU doesn't work there), so it will hard for me to combat in LS.
Why did you remove all the Smolstr usage? |
Maybe StringId? Suggestion: StringId |
why is this change is the same PR? Code quote: let mut last: Option<&Modifier> = None; |
Suggestion: simple.ident(syntax_db).text(syntax_db).lookup_intern(self.db).as_ref() == "super" |
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.
Reviewed 92 of 124 files at r1, all commit messages.
Reviewable status: 92 of 124 files reviewed, 4 unresolved discussions (waiting on @gilbens-starkware and @orizi)
crates/cairo-lang-semantic/src/resolve/mod.rs
line 502 at r1 (raw file):
ast::PathSegment::WithGenericArgs(_) => false, ast::PathSegment::Simple(simple) => { simple.ident(syntax_db).text(syntax_db) == TextId::interned("super", self.db)
other places as well.
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.
Most of it should just have become the inner arc - there may be some spill over.
in any case - it seems the over abundance of arc is enough of an issue to make this not really worth it.
Reviewable status: 92 of 124 files reviewed, 4 unresolved discussions (waiting on @gilbens-starkware, @ilyalesokhin-starkware, and @mkaput)
a discussion (no related file):
Previously, mkaput (Marek Kaput) wrote…
This change sounds like it will create a massive memory leak-style behaviour, especially in the LS. Salsa has no means for garbage collection for interned items (LRU doesn't work there), so it will hard for me to combat in LS.
this is no worse than the entire existing db - only removing the duplication of data.
crates/cairo-lang-semantic/src/items/modifiers.rs
line 16 at r1 (raw file):
Previously, ilyalesokhin-starkware wrote…
why is this change is the same PR?
it was removal of being text dependent.
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.
Reviewable status: 92 of 124 files reviewed, 4 unresolved discussions (waiting on @gilbens-starkware, @ilyalesokhin-starkware, and @orizi)
a discussion (no related file):
Previously, orizi wrote…
this is no worse than the entire existing db - only removing the duplication of data.
Yes, it is no worse, but it's also not better, and I think it'd be better to only take steps towards better memory management?
Have you measured how much memory is actually deduplicated here? Note that Arc<str>
and SmolStr
do also deduplicate clones, yet they properly deallocate when the last instance is dropped.
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.
Reviewed 124 of 124 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @gilbens-starkware, @ilyalesokhin-starkware, and @orizi)
a discussion (no related file):
FYI https://doc.rust-lang.org/stable/alloc/sync/struct.Arc.html#impl-Default-for-Arc%3Cstr%3E stabilized in Rust 1.80
This change is