Skip to content
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 size of task output struct #8557

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions crates/turbo-tasks-memory/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::MemoryBackend;
#[derive(Default, Debug)]
pub struct Output {
pub(crate) content: OutputContent,
updates: u32,
pub(crate) dependent_tasks: TaskIdSet,
}

Expand All @@ -22,7 +21,7 @@ pub enum OutputContent {
Empty,
Link(RawVc),
Error(SharedError),
Panic(Option<Cow<'static, str>>),
Panic(Option<Box<Cow<'static, str>>>),
}

impl Display for OutputContent {
Expand Down Expand Up @@ -62,7 +61,6 @@ impl Output {

pub fn error(&mut self, error: Error, turbo_tasks: &dyn TurboTasksBackendApi<MemoryBackend>) {
self.content = OutputContent::Error(SharedError::new(error));
self.updates += 1;
// notify
if !self.dependent_tasks.is_empty() {
turbo_tasks.schedule_notify_tasks_set(&take(&mut self.dependent_tasks));
Expand All @@ -74,8 +72,7 @@ impl Output {
message: Option<Cow<'static, str>>,
turbo_tasks: &dyn TurboTasksBackendApi<MemoryBackend>,
) {
self.content = OutputContent::Panic(message);
self.updates += 1;
self.content = OutputContent::Panic(message.map(Box::new));
// notify
if !self.dependent_tasks.is_empty() {
turbo_tasks.schedule_notify_tasks_set(&take(&mut self.dependent_tasks));
Expand All @@ -88,7 +85,6 @@ impl Output {
turbo_tasks: &dyn TurboTasksBackendApi<MemoryBackend>,
) {
self.content = content;
self.updates += 1;
// notify
if !self.dependent_tasks.is_empty() {
turbo_tasks.schedule_notify_tasks_set(&take(&mut self.dependent_tasks));
Expand Down
Loading