Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
f4fc1a64
Unverified
Commit
f4fc1a64
authored
May 16, 2025
by
Donny/강동윤
Committed by
GitHub
May 16, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "perf(turbopack): Use rayon threadpool for `minify()`" (#79296)
Reverts vercel/next.js#79261 because it regressed RSS
parent
e0c2e2ae
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
19 deletions
+6
-19
Cargo.lock
Cargo.lock
+0
-1
content.rs
turbopack/crates/turbopack-browser/src/ecmascript/content.rs
+1
-1
chunk.rs
...crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs
+1
-1
Cargo.toml
turbopack/crates/turbopack-ecmascript/Cargo.toml
+0
-1
minify.rs
turbopack/crates/turbopack-ecmascript/src/minify.rs
+3
-14
content.rs
...ck/crates/turbopack-nodejs/src/ecmascript/node/content.rs
+1
-1
No files found.
Cargo.lock
View file @
f4fc1a64
...
@@ -10162,7 +10162,6 @@ dependencies = [
...
@@ -10162,7 +10162,6 @@ dependencies = [
"par-core",
"par-core",
"parking_lot",
"parking_lot",
"petgraph 0.6.3",
"petgraph 0.6.3",
"rayon",
"regex",
"regex",
"rustc-hash 2.1.1",
"rustc-hash 2.1.1",
"serde",
"serde",
...
...
turbopack/crates/turbopack-browser/src/ecmascript/content.rs
View file @
f4fc1a64
...
@@ -128,7 +128,7 @@ impl EcmascriptBrowserChunkContent {
...
@@ -128,7 +128,7 @@ impl EcmascriptBrowserChunkContent {
let
mut
code
=
code
.build
();
let
mut
code
=
code
.build
();
if
let
MinifyType
::
Minify
{
mangle
}
=
this
.chunking_context.await
?
.minify_type
()
{
if
let
MinifyType
::
Minify
{
mangle
}
=
this
.chunking_context.await
?
.minify_type
()
{
code
=
minify
(
code
,
source_maps
,
mangle
)
.await
?
;
code
=
minify
(
&
code
,
source_maps
,
mangle
)
?
;
}
}
Ok
(
code
.cell
())
Ok
(
code
.cell
())
...
...
turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs
View file @
f4fc1a64
...
@@ -194,7 +194,7 @@ impl EcmascriptBrowserEvaluateChunk {
...
@@ -194,7 +194,7 @@ impl EcmascriptBrowserEvaluateChunk {
let
mut
code
=
code
.build
();
let
mut
code
=
code
.build
();
if
let
MinifyType
::
Minify
{
mangle
}
=
this
.chunking_context.await
?
.minify_type
()
{
if
let
MinifyType
::
Minify
{
mangle
}
=
this
.chunking_context.await
?
.minify_type
()
{
code
=
minify
(
code
,
source_maps
,
mangle
)
.await
?
;
code
=
minify
(
&
code
,
source_maps
,
mangle
)
?
;
}
}
Ok
(
code
.cell
())
Ok
(
code
.cell
())
...
...
turbopack/crates/turbopack-ecmascript/Cargo.toml
View file @
f4fc1a64
...
@@ -44,7 +44,6 @@ turbopack-resolve = { workspace = true }
...
@@ -44,7 +44,6 @@ turbopack-resolve = { workspace = true }
turbopack-swc-utils
=
{
workspace
=
true
}
turbopack-swc-utils
=
{
workspace
=
true
}
url
=
{
workspace
=
true
}
url
=
{
workspace
=
true
}
urlencoding
=
{
workspace
=
true
}
urlencoding
=
{
workspace
=
true
}
rayon
=
{
workspace
=
true
}
swc_core
=
{
workspace
=
true
,
features
=
[
swc_core
=
{
workspace
=
true
,
features
=
[
"ecma_ast"
,
"ecma_ast"
,
...
...
turbopack/crates/turbopack-ecmascript/src/minify.rs
View file @
f4fc1a64
...
@@ -31,18 +31,7 @@ use turbopack_core::{
...
@@ -31,18 +31,7 @@ use turbopack_core::{
use
crate
::
parse
::
generate_js_source_map
;
use
crate
::
parse
::
generate_js_source_map
;
#[instrument(level
=
Level
::
INFO,
skip_all)]
#[instrument(level
=
Level
::
INFO,
skip_all)]
pub
async
fn
minify
(
code
:
Code
,
source_maps
:
bool
,
mangle
:
Option
<
MangleType
>
)
->
Result
<
Code
>
{
pub
fn
minify
(
code
:
&
Code
,
source_maps
:
bool
,
mangle
:
Option
<
MangleType
>
)
->
Result
<
Code
>
{
let
(
tx
,
rx
)
=
tokio
::
sync
::
oneshot
::
channel
();
rayon
::
spawn
(
move
||
{
let
result
=
minify_inner
(
code
,
source_maps
,
mangle
);
tx
.send
(
result
)
.unwrap
();
});
rx
.await
.unwrap
()
}
fn
minify_inner
(
code
:
Code
,
source_maps
:
bool
,
mangle
:
Option
<
MangleType
>
)
->
Result
<
Code
>
{
let
source_maps
=
source_maps
let
source_maps
=
source_maps
.then
(||
code
.generate_source_map_ref
())
.then
(||
code
.generate_source_map_ref
())
.transpose
()
?
;
.transpose
()
?
;
...
@@ -150,8 +139,8 @@ fn minify_inner(code: Code, source_maps: bool, mangle: Option<MangleType>) -> Re
...
@@ -150,8 +139,8 @@ fn minify_inner(code: Code, source_maps: bool, mangle: Option<MangleType>) -> Re
src_map_buf
,
src_map_buf
,
Some
(
original_map
),
Some
(
original_map
),
// We do not inline source contents.
// We do not inline source contents.
// We provide a synthesized value to `cm.new_source_file` above, so it cannot
// We provide a synthesized value to `cm.new_source_file` above, so it cannot
be
//
be
the value user expect anyway.
// the value user expect anyway.
false
,
false
,
)
?
),
)
?
),
);
);
...
...
turbopack/crates/turbopack-nodejs/src/ecmascript/node/content.rs
View file @
f4fc1a64
...
@@ -78,7 +78,7 @@ impl EcmascriptBuildNodeChunkContent {
...
@@ -78,7 +78,7 @@ impl EcmascriptBuildNodeChunkContent {
let
mut
code
=
code
.build
();
let
mut
code
=
code
.build
();
if
let
MinifyType
::
Minify
{
mangle
}
=
this
.chunking_context.await
?
.minify_type
()
{
if
let
MinifyType
::
Minify
{
mangle
}
=
this
.chunking_context.await
?
.minify_type
()
{
code
=
minify
(
code
,
source_maps
,
mangle
)
.await
?
;
code
=
minify
(
&
code
,
source_maps
,
mangle
)
?
;
}
}
Ok
(
code
.cell
())
Ok
(
code
.cell
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment