Turbopack: Implement TraceRawVcs and NonLocalValue correctly for Effects#89133
Turbopack: Implement TraceRawVcs and NonLocalValue correctly for Effects#89133
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Tests Passed |
Merging this PR will degrade performance by 3.83%
Performance Changes
Comparing Footnotes
|
| EffectState::NotStarted(_) => { | ||
| let EffectState::NotStarted(inner) = std::mem::replace( | ||
| &mut *guard, | ||
| EffectState::Started(Event::new(|| || "Effect".to_string())), | ||
| ) else { | ||
| unreachable!(); | ||
| let EffectState::NotStarted(effect) = | ||
| std::mem::replace(&mut *guard, EffectState::Invalid) | ||
| else { | ||
| unreachable!() | ||
| }; | ||
| State::NotStarted(inner) | ||
| let effect: Arc<dyn DynEffect> = Arc::from(effect); | ||
| *guard = EffectState::Started( | ||
| effect.clone(), | ||
| Event::new(|| || "Effect".to_string()), | ||
| ); | ||
| State::NotStarted(effect) |
There was a problem hiding this comment.
can't we just capture effect in the match condition and then assign back? i guess that requires an additional clone on the effect Arc?
There was a problem hiding this comment.
I actually tried rewriting it that way, using a manual drop(guard) call. The appears to be some limitation of rustc's analysis here that cause it to think that the future is no longer Send because it thinks the mutex guard might get held across an await point (even though it isn't because of the drop(guard) call).
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📎 Tarball URL |
c11b2a1 to
fd04529
Compare
fd04529 to
ebd1c55
Compare
b7bb365 to
0a0ee57
Compare
ebd1c55 to
d6f9660
Compare
d6f9660 to
e1ace25
Compare
e1ace25 to
7ed4ec1
Compare
7ed4ec1 to
457fced
Compare

In subsequent PRs, I want to store a
ResolvedVc(specifically, aFileSystemPath, which contains aVc<Box<dyn FileSystem>>) inside of anEffect.To do this in a way that wouldn't break a hypothetical future tracing garbage collector, we must implement
TraceRawVcsonEffect.The previous PR changed the
Effecttype from a closure to a trait in order to enable this.