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

Transient tasks #8764

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Transient tasks #8764

wants to merge 4 commits into from

Conversation

sokra
Copy link
Member

@sokra sokra commented Jul 16, 2024

Description

Track which tasks are transient and which are persistent. We need to track that for persistent caching.

We used a different task id space for transient tasks so they don't use up persistent ids and to easily identify transient tasks.

Testing Instructions

Copy link

vercel bot commented Jul 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2024 6:53am
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 26, 2024 6:53am
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 6:53am
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 6:53am
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 6:53am
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 6:53am
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 6:53am
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 6:53am
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 6:53am
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 6:53am

Copy link
Member Author

sokra commented Jul 16, 2024

@sokra sokra changed the title use different task ids for persistent and transient tasks Transient tasks Jul 16, 2024
Copy link
Contributor

github-actions bot commented Jul 16, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented Jul 16, 2024

✅ This change can build next-swc

Copy link
Contributor

github-actions bot commented Jul 16, 2024

⚠️ CI failed ⚠️

The following steps have failed in CI:

  • Turbopack Rust tests (mac/win, non-blocking)
  • Turbopack Rust benchmark tests (linux)

See workflow summary for details

@@ -77,6 +77,14 @@ impl Debug for TaskId {
}
}

pub const TRANSIENT_TASK_BIT: u32 = 0x8000_0000;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could go for 0xc000_0000 if we need more space for persistent tasks. That would work with the system, but I keep it in the middle for now

@sokra sokra requested a review from bgw July 24, 2024 16:18
Copy link
Member

@bgw bgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love that this duplicates a lot of functions and logic, but I'm okay with it, and there's probably not much more that can be done for that.

@@ -292,6 +319,74 @@ impl MemoryBackend {
pub fn task_statistics(&self) -> &TaskStatisticsApi {
&self.task_statistics
}

fn track_cache_hit(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for moving my garbage out into a separate function!

@sokra sokra enabled auto-merge (squash) July 29, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants