fix(turbopack): OOM fast path for WASM + bump tokio-fs-ext 0.7.8#122
fix(turbopack): OOM fast path for WASM + bump tokio-fs-ext 0.7.8#122
Conversation
- Add no-restore fast path in prepare_tasks_with_callback to avoid huge Vec allocation when using NoopKvDb (WASM environments) - Bump tokio-fs-ext to 0.7.8 in turbo-tasks-fs (stale dir handle fix)
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a targeted performance improvement for Turbopack's backend operations by optimizing task preparation in environments without backing storage, such as WASM. Concurrently, it updates a core file system utility dependency to resolve a known issue with stale directory handles, enhancing overall stability. These changes collectively aim to improve efficiency and reliability within the Turbopack ecosystem. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a fast path in prepare_tasks_with_callback to skip a vector allocation in WASM environments, aiming to prevent out-of-memory issues. It also bumps the tokio-fs-ext dependency to version 0.7.8. My review includes a suggestion to simplify a conditional statement in the new fast path for improved readability.
| if id.is_transient() { | ||
| if call_prepared_task_callback_for_transient_tasks { | ||
| prepared_task_callback(self, id, category, task); | ||
| } | ||
| } else { | ||
| prepared_task_callback(self, id, category, task); | ||
| } |
There was a problem hiding this comment.
The conditional logic for calling prepared_task_callback can be simplified. The current nested if and else block can be expressed as a single if statement with a compound condition. This improves readability and reduces code nesting.
if !id.is_transient() || call_prepared_task_callback_for_transient_tasks {
prepared_task_callback(self, id, category, task);
}
prepare_tasks_with_callbackto skip Vec allocation in WASM/NoopKvDbtokio-fs-extto 0.7.8 inturbo-tasks-fs(stale dir handle retry fix)