Skip to content

Commit a6e6ebe

Browse files
authored
perf: Replace rayon with par-iter (#10774)
**Description:** It seems like I made a mistake while migrating to `par-iter`
1 parent c686c7f commit a6e6ebe

File tree

20 files changed

+38
-60
lines changed

20 files changed

+38
-60
lines changed

.changeset/spotty-donuts-laugh.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
dbg-swc: patch
3+
hstr: patch
4+
swc_cli_impl: patch
5+
swc_common: patch
6+
swc_css_lints: patch
7+
swc_ecma_transforms_base: patch
8+
swc_core: patch
9+
---
10+
11+
perf: Replace `rayon` with `par-iter`

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ pkg/
6464
swc-core-*.tgz
6565

6666
# samply
67-
profile.json
67+
profile.json
68+
profile.json.gz

Cargo.lock

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/dbg-swc/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ clap = { version = "3", features = ["derive"] }
1717
dialoguer = { workspace = true }
1818
flate2 = { workspace = true }
1919
par-core = { workspace = true, features = ["chili"] }
20+
par-iter = { workspace = true }
2021
rayon = { workspace = true }
2122
serde = { workspace = true }
2223
serde_json = { workspace = true }

crates/dbg-swc/src/es/minifier/ensure_size.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{
55

66
use anyhow::{Context, Result};
77
use clap::Args;
8-
use rayon::prelude::*;
8+
use par_iter::prelude::*;
99
use swc_common::{
1010
errors::{ColorConfig, Handler, HANDLER},
1111
SourceFile, SourceMap, GLOBALS,

crates/dbg-swc/src/es/minifier/reduce.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::{
88

99
use anyhow::{Context, Result};
1010
use clap::{ArgEnum, Args};
11-
use rayon::prelude::*;
11+
use par_iter::prelude::*;
1212
use sha1::{Digest, Sha1};
1313
use swc_common::{SourceMap, GLOBALS};
1414
use tempfile::TempDir;

crates/hstr/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ compact_str = { workspace = true }
3333
criterion = { workspace = true }
3434
kstring = { workspace = true }
3535
num_cpus = { workspace = true }
36+
par-iter = { workspace = true }
3637
rand = { workspace = true }
37-
rayon = { workspace = true }
3838
smartstring = { workspace = true }
3939
smol_str = { workspace = true }
4040
string_cache = { workspace = true }

crates/hstr/benches/libs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use std::{hash::Hash, mem::forget};
88

99
use compact_str::CompactString;
1010
use criterion::{black_box, BatchSize, BenchmarkId, Criterion};
11+
use par_iter::prelude::*;
1112
use rand::distributions::{Alphanumeric, DistString};
12-
use rayon::prelude::*;
1313
use rustc_hash::FxHashSet;
1414
use smartstring::{LazyCompact, SmartString};
1515

crates/swc_cli_impl/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ anyhow = { workspace = true }
2828
clap = { version = "3.2.25", features = ["derive", "wrap_help"] }
2929
glob = { workspace = true }
3030
par-core = { workspace = true, features = ["chili"] }
31+
par-iter = { workspace = true }
3132
path-absolutize = { workspace = true, features = ["once_cell_cache"] }
32-
rayon = { workspace = true }
3333
relative-path = { workspace = true }
3434
serde = { workspace = true, features = ["derive"] }
3535
serde_json = { workspace = true, features = ["unbounded_depth"] }

crates/swc_cli_impl/src/commands/compile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use std::{
88
use anyhow::Context;
99
use clap::Parser;
1010
use glob::glob;
11+
use par_iter::prelude::*;
1112
use path_absolutize::Absolutize;
12-
use rayon::prelude::*;
1313
use relative_path::RelativePath;
1414
use swc_core::{
1515
base::{

0 commit comments

Comments
 (0)