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

refactor: Fix binary bloat caused by ValueDebugFormat impl #5102

Merged
merged 7 commits into from
May 26, 2023

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented May 26, 2023

Description

    Finished release [optimized] target(s) in 0.43s
    Analyzing target/release/libnext_swc_napi.dylib

 File  .text     Size                          Crate Name
 0.1%   0.3% 185.1KiB               swc_css_prefixer <swc_css_prefixer::prefixer::Prefixer as swc_css_visit::VisitMut>::visit_mut_declaration
 0.0%   0.1%  53.9KiB       swc_ecma_transforms_base <swc_ecma_transforms_base::helpers::InjectHelpers>::build_imports::{closure#0}
 0.0%   0.1%  41.4KiB                      next_core <next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}
 0.0%   0.1%  39.6KiB                 turbopack_core turbopack_core::register
 0.0%   0.1%  36.5KiB                            std core::ptr::drop_in_place::<<next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}>
 0.0%   0.1%  36.5KiB                            std core::ptr::drop_in_place::<<next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}>
 0.0%   0.1%  34.5KiB           turbopack_ecmascript turbopack_ecmascript::register
 0.0%   0.1%  34.4KiB                      next_core next_core::register
 0.0%   0.1%  32.6KiB     swc_ecma_transforms_module <swc_ecma_transforms_module::system_js::SystemJs as swc_ecma_visit::Fold>::fold_module
 0.0%   0.0%  30.5KiB                          regex <regex::exec::ExecNoSync as regex::re_trait::RegularExpression>::captures_read_at
 0.0%   0.0%  27.5KiB                   browserslist browserslist::data::caniuse::features::get_feature_stat
 0.0%   0.0%  27.5KiB                            swc <swc::config::Options>::build_as_input::<swc_visit::AndThen<swc_visit::Optional<next_swc::disallow_re_export_all_in_page::DisallowReExportAllInPage>, swc_visit::AndThen<either::Either<swc_e...
 0.0%   0.0%  27.2KiB           turbopack_ecmascript turbopack_ecmascript::references::analyze_ecmascript_module_inline::{closure#0}

Testing Instructions


@kdy1 kdy1 self-assigned this May 26, 2023
@vercel
Copy link

vercel bot commented May 26, 2023

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

Name Status Preview Comments Updated (UTC)
examples-cra-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 26, 2023 5:44am
examples-designsystem-docs 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 26, 2023 5:44am
examples-svelte-web 🔄 Building (Inspect) Visit Preview 💬 Add feedback May 26, 2023 5:44am
8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview May 26, 2023 5:44am
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview May 26, 2023 5:44am
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview May 26, 2023 5:44am
examples-native-web ⬜️ Ignored (Inspect) Visit Preview May 26, 2023 5:44am
examples-nonmonorepo ⬜️ Ignored (Inspect) Visit Preview May 26, 2023 5:44am
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview May 26, 2023 5:44am
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview May 26, 2023 5:44am
turbo-site ⬜️ Ignored (Inspect) Visit Preview May 26, 2023 5:44am

@github-actions
Copy link
Contributor

✅ This change can build next-swc

@github-actions
Copy link
Contributor

github-actions bot commented May 26, 2023

⚠️ CI failed ⚠️

The following steps have failed in CI:

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

See workflow summary for details

use crate::debug::ValueDebugFormatString;

#[inline(never)]
pub async fn value_debug_format_field(value: ValueDebugFormatString<'_>) -> String {
Copy link
Member Author

Choose a reason for hiding this comment

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

I modified this to accept ValueDebugFormatString instead of dyn (ValueDebugFormat + Sync) because we need deref coercion to make macro work

@kdy1 kdy1 marked this pull request as ready for review May 26, 2023 05:02
@kdy1 kdy1 requested a review from a team as a code owner May 26, 2023 05:02
@github-actions
Copy link
Contributor

Linux Benchmark for 489975b

Click to view benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 9226.14µs ± 110.11µs 8992.87µs ± 59.82µs -2.53%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7947.48µs ± 85.73µs 8191.67µs ± 201.67µs +3.07%
bench_startup/Turbopack CSR/1000 modules 893.32ms ± 1.69ms 886.64ms ± 4.44ms -0.75%

crates/turbo-tasks/src/macro_helpers.rs Outdated Show resolved Hide resolved
crates/turbo-tasks/src/lib.rs Show resolved Hide resolved
kdy1 and others added 2 commits May 26, 2023 14:42
@github-actions
Copy link
Contributor

Linux Benchmark for a5c3b84

Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8968.69µs ± 108.75µs 9377.81µs ± 29.43µs +4.56% +1.45%
bench_startup/Turbopack CSR/1000 modules 889.44ms ± 2.93ms 915.54ms ± 4.69ms +2.94% +1.21%
Click to view full benchmark
Test Base PR % Significant %
bench_hmr_to_commit/Turbopack CSR/1000 modules 8968.69µs ± 108.75µs 9377.81µs ± 29.43µs +4.56% +1.45%
bench_hmr_to_eval/Turbopack CSR/1000 modules 7918.67µs ± 120.55µs 7940.41µs ± 74.91µs +0.27%
bench_startup/Turbopack CSR/1000 modules 889.44ms ± 2.93ms 915.54ms ± 4.69ms +2.94% +1.21%

@kdy1 kdy1 added the pr: automerge Kodiak will merge these automatically after checks pass label May 26, 2023
@kodiakhq kodiakhq bot merged commit 2a26179 into main May 26, 2023
@kodiakhq kodiakhq bot deleted the kdy1/compile-time branch May 26, 2023 06:20
sokra pushed a commit to vercel/next.js that referenced this pull request May 26, 2023
This PR is extracted from #49942
and mostly contains changes necessary after the Turbopack PR adding the
Node.js production runtime vercel/turborepo#4998,
without any of the actual Next Build stuff, in order to be able to merge
both quickly.

* ChunkData moved from tp-dev to tp-core, the ES-serializable part moved
to tp-ecmascript;
* all runtime types moved to tp-ecmascript-runtime

This also upgrades Turbopack to turbopack-230526.2:

* vercel/turborepo#5102 <!-- Donny/강동윤 - refactor:
Fix binary bloat caused by `ValueDebugFormat` impl -->
* vercel/turborepo#4998 <!-- Alex Kirszenberg -
Node.js production runtime POC -->
hydRAnger pushed a commit to hydRAnger/next.js that referenced this pull request Jun 12, 2023
…el#50375)

This PR is extracted from vercel#49942
and mostly contains changes necessary after the Turbopack PR adding the
Node.js production runtime vercel/turborepo#4998,
without any of the actual Next Build stuff, in order to be able to merge
both quickly.

* ChunkData moved from tp-dev to tp-core, the ES-serializable part moved
to tp-ecmascript;
* all runtime types moved to tp-ecmascript-runtime

This also upgrades Turbopack to turbopack-230526.2:

* vercel/turborepo#5102 <!-- Donny/강동윤 - refactor:
Fix binary bloat caused by `ValueDebugFormat` impl -->
* vercel/turborepo#4998 <!-- Alex Kirszenberg -
Node.js production runtime POC -->
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…turborepo#5102)

### Description

```
    Finished release [optimized] target(s) in 0.43s
    Analyzing target/release/libnext_swc_napi.dylib

 File  .text     Size                          Crate Name
 0.1%   0.3% 185.1KiB               swc_css_prefixer <swc_css_prefixer::prefixer::Prefixer as swc_css_visit::VisitMut>::visit_mut_declaration
 0.0%   0.1%  53.9KiB       swc_ecma_transforms_base <swc_ecma_transforms_base::helpers::InjectHelpers>::build_imports::{closure#0}
 0.0%   0.1%  41.4KiB                      next_core <next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}
 0.0%   0.1%  39.6KiB                 turbopack_core turbopack_core::register
 0.0%   0.1%  36.5KiB                            std core::ptr::drop_in_place::<<next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}>
 0.0%   0.1%  36.5KiB                            std core::ptr::drop_in_place::<<next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}>
 0.0%   0.1%  34.5KiB           turbopack_ecmascript turbopack_ecmascript::register
 0.0%   0.1%  34.4KiB                      next_core next_core::register
 0.0%   0.1%  32.6KiB     swc_ecma_transforms_module <swc_ecma_transforms_module::system_js::SystemJs as swc_ecma_visit::Fold>::fold_module
 0.0%   0.0%  30.5KiB                          regex <regex::exec::ExecNoSync as regex::re_trait::RegularExpression>::captures_read_at
 0.0%   0.0%  27.5KiB                   browserslist browserslist::data::caniuse::features::get_feature_stat
 0.0%   0.0%  27.5KiB                            swc <swc::config::Options>::build_as_input::<swc_visit::AndThen<swc_visit::Optional<next_swc::disallow_re_export_all_in_page::DisallowReExportAllInPage>, swc_visit::AndThen<either::Either<swc_e...
 0.0%   0.0%  27.2KiB           turbopack_ecmascript turbopack_ecmascript::references::analyze_ecmascript_module_inline::{closure#0}
```

### Testing Instructions




---

 - Closes WEB-1116

---------

Co-authored-by: Justin Ridgewell <[email protected]>
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…turborepo#5102)

### Description

```
    Finished release [optimized] target(s) in 0.43s
    Analyzing target/release/libnext_swc_napi.dylib

 File  .text     Size                          Crate Name
 0.1%   0.3% 185.1KiB               swc_css_prefixer <swc_css_prefixer::prefixer::Prefixer as swc_css_visit::VisitMut>::visit_mut_declaration
 0.0%   0.1%  53.9KiB       swc_ecma_transforms_base <swc_ecma_transforms_base::helpers::InjectHelpers>::build_imports::{closure#0}
 0.0%   0.1%  41.4KiB                      next_core <next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}
 0.0%   0.1%  39.6KiB                 turbopack_core turbopack_core::register
 0.0%   0.1%  36.5KiB                            std core::ptr::drop_in_place::<<next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}>
 0.0%   0.1%  36.5KiB                            std core::ptr::drop_in_place::<<next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}>
 0.0%   0.1%  34.5KiB           turbopack_ecmascript turbopack_ecmascript::register
 0.0%   0.1%  34.4KiB                      next_core next_core::register
 0.0%   0.1%  32.6KiB     swc_ecma_transforms_module <swc_ecma_transforms_module::system_js::SystemJs as swc_ecma_visit::Fold>::fold_module
 0.0%   0.0%  30.5KiB                          regex <regex::exec::ExecNoSync as regex::re_trait::RegularExpression>::captures_read_at
 0.0%   0.0%  27.5KiB                   browserslist browserslist::data::caniuse::features::get_feature_stat
 0.0%   0.0%  27.5KiB                            swc <swc::config::Options>::build_as_input::<swc_visit::AndThen<swc_visit::Optional<next_swc::disallow_re_export_all_in_page::DisallowReExportAllInPage>, swc_visit::AndThen<either::Either<swc_e...
 0.0%   0.0%  27.2KiB           turbopack_ecmascript turbopack_ecmascript::references::analyze_ecmascript_module_inline::{closure#0}
```

### Testing Instructions




---

 - Closes WEB-1116

---------

Co-authored-by: Justin Ridgewell <[email protected]>
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…turborepo#5102)

### Description

```
    Finished release [optimized] target(s) in 0.43s
    Analyzing target/release/libnext_swc_napi.dylib

 File  .text     Size                          Crate Name
 0.1%   0.3% 185.1KiB               swc_css_prefixer <swc_css_prefixer::prefixer::Prefixer as swc_css_visit::VisitMut>::visit_mut_declaration
 0.0%   0.1%  53.9KiB       swc_ecma_transforms_base <swc_ecma_transforms_base::helpers::InjectHelpers>::build_imports::{closure#0}
 0.0%   0.1%  41.4KiB                      next_core <next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}
 0.0%   0.1%  39.6KiB                 turbopack_core turbopack_core::register
 0.0%   0.1%  36.5KiB                            std core::ptr::drop_in_place::<<next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}>
 0.0%   0.1%  36.5KiB                            std core::ptr::drop_in_place::<<next_core::next_config::NextConfig>::__value_debug_format_NextConfig::{closure#0}>
 0.0%   0.1%  34.5KiB           turbopack_ecmascript turbopack_ecmascript::register
 0.0%   0.1%  34.4KiB                      next_core next_core::register
 0.0%   0.1%  32.6KiB     swc_ecma_transforms_module <swc_ecma_transforms_module::system_js::SystemJs as swc_ecma_visit::Fold>::fold_module
 0.0%   0.0%  30.5KiB                          regex <regex::exec::ExecNoSync as regex::re_trait::RegularExpression>::captures_read_at
 0.0%   0.0%  27.5KiB                   browserslist browserslist::data::caniuse::features::get_feature_stat
 0.0%   0.0%  27.5KiB                            swc <swc::config::Options>::build_as_input::<swc_visit::AndThen<swc_visit::Optional<next_swc::disallow_re_export_all_in_page::DisallowReExportAllInPage>, swc_visit::AndThen<either::Either<swc_e...
 0.0%   0.0%  27.2KiB           turbopack_ecmascript turbopack_ecmascript::references::analyze_ecmascript_module_inline::{closure#0}
```

### Testing Instructions




---

 - Closes WEB-1116

---------

Co-authored-by: Justin Ridgewell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Kodiak will merge these automatically after checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants