-
Notifications
You must be signed in to change notification settings - Fork 38
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
Side quest: Optimize ReadOnlyInvocationStatusTable#all_invoked_or_killed_invocations #2349
base: main
Are you sure you want to change the base?
Side quest: Optimize ReadOnlyInvocationStatusTable#all_invoked_or_killed_invocations #2349
Conversation
…t after a kill, the invoker will send a "terminal" effect to the state machine.
Also replace the individual booleans for experimental features with enum set.
…ons, by avoiding loading the full InvocationStatus in memory.
#[derive(Clone, Copy, Debug, PartialEq, Eq)] | ||
pub enum InvocationStatusDiscriminants { | ||
Scheduled, | ||
Inboxed, | ||
Invoked, | ||
Suspended, | ||
Killed, | ||
Completed, | ||
} | ||
|
||
/// Lite status of an invocation. | ||
#[derive(Debug, Clone, Eq, PartialEq)] | ||
pub struct InvocationLite { | ||
pub status: InvocationStatusDiscriminants, | ||
pub invocation_target: InvocationTarget, | ||
} | ||
|
||
protobuf_storage_encode_decode!(InvocationLite, crate::storage::v1::InvocationV2Lite); |
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 only reason for this type to be here is the package organization, otherwise i could have hid everything in the partition-store module (and i could have even avoided defining the Lite type in the domain.proto).
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.
I guess this is good reason to correct this part eventually.
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.
Nice optimization :-) LGTM. +1 for merging.
#[derive(Clone, Copy, Debug, PartialEq, Eq)] | ||
pub enum InvocationStatusDiscriminants { | ||
Scheduled, | ||
Inboxed, | ||
Invoked, | ||
Suspended, | ||
Killed, | ||
Completed, | ||
} | ||
|
||
/// Lite status of an invocation. | ||
#[derive(Debug, Clone, Eq, PartialEq)] | ||
pub struct InvocationLite { | ||
pub status: InvocationStatusDiscriminants, | ||
pub invocation_target: InvocationTarget, | ||
} | ||
|
||
protobuf_storage_encode_decode!(InvocationLite, crate::storage::v1::InvocationV2Lite); |
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.
I guess this is good reason to correct this part eventually.
This avoids loading the full InvocationStatus in memory, only to read invocation target and status. Depends on #2335, only the last commit is relevant to this PR