-
Notifications
You must be signed in to change notification settings - Fork 83
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
Should not sleep Fixes #356
base: master
Are you sure you want to change the base?
Conversation
- Updates tests - Adds regression test
@@ -562,7 +562,6 @@ pub struct AnalyzeObjectTree<'o> { | |||
impure_procs: ViolatingProcs<'o>, | |||
waitfor_procs: HashSet<ProcRef<'o>>, | |||
|
|||
sleeping_overrides: ViolatingOverrides<'o>, |
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.
The way this was implemented wasn't effective and the cause of the misses because it didn't catch overrides that called that called procs that slept.
/// Recursively visit this and all child **types**. | ||
pub fn recurse_types<F: FnMut(TypeRef<'a>)>(&self, f: &mut F) { | ||
self.recurse(f); | ||
for parent_typed_idx in &self.tree.redirected_parent_types { |
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 is going to visit things multiple times
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.
Is it? redirected_parent_types
should only be populated with things that have different parent_type
s from their default path (i.e. setting parent_type = /mob
on /mob/living
is a no-op). So if recurse
only hits direct child paths I don't see how it'd hit things multiple times.
As it stands, this is still too slow and uses way too much memory. More improvements incoming. |
Okay @SpaceManiac This is latest on /tg/. The 7228 is the number of procs infected with SHOULD_NOT_SLEEP to begin with. Each print-out represents 10s of work.
At this point the only optimization I can think of is to NEVER revisit procs (currently procs that don't have a sleep somewhere in their calls can get revisited) It would result in a slightly incomplete error set but it might be worth it. |
I'm going to go ahead and do that |
Back under 5s. It no longer prints out transitive errors but the time save is worth it. |
There's a bug where the checking in |
No measurable change to checking time.
/tg/ circa now |
If anyone wants to take over this PR. It's basically done, except you need to get the commented out test from the above commit working |
Fixes #355
Also splits SHOULD_NOT_SLEEP and SHOULD_BE_PURE tests and adds a minor improvement to the test helpers in that it shows more info where it wouldn't when
panic
ing