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

perf(es/minifier): Improve parallelism and cache friendliness #9813

Merged
merged 9 commits into from
Jan 1, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove needless clone
  • Loading branch information
kdy1 committed Jan 1, 2025
commit 15d696527be95c8fe2275c160d78f4bb48fb74a8
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ impl Data {
}

/// Add an edge to dependency graph
fn add_dep_edge(&mut self, from: Id, to: Id, assign: bool) {
let from = self.node(&from);
let to = self.node(&to);
fn add_dep_edge(&mut self, from: &Id, to: &Id, assign: bool) {
let from = self.node(from);
let to = self.node(to);

match self.graph.edge_weight_mut(from, to) {
Some(info) => {
Expand Down Expand Up @@ -335,8 +335,7 @@ impl Analyzer<'_> {

while let Some(s) = scope {
for component in &s.ast_path {
self.data
.add_dep_edge(component.clone(), id.clone(), assign)
self.data.add_dep_edge(component, &id, assign);
}

if s.kind == ScopeKind::Fn && !s.ast_path.is_empty() {
Expand Down