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

DFS refactor work #9648

Merged
merged 11 commits into from
Apr 22, 2024
Merged

DFS refactor work #9648

merged 11 commits into from
Apr 22, 2024

Conversation

yamadapc
Copy link
Contributor

  • Using iterative DFS implementation for all cases
  • Added unit-tests

I need help with:

  • running a benchmark

I will do clean-up around:

  • safe roll-out (like a feature-flag or more tests)
  • remove old method

Missing from this diff is:

  • Replacing getChildren with a few generator/callback based options

@yamadapc yamadapc marked this pull request as ready for review April 18, 2024 01:35
packages/core/graph/src/Graph.js Outdated Show resolved Hide resolved
packages/core/graph/src/Graph.js Show resolved Hide resolved
packages/core/graph/src/Graph.js Outdated Show resolved Hide resolved
if (command.exit != null) {
let {nodeId, context, exit} = command;
let newContext = exit(nodeId, command.context, actions);
if (typeof newContext !== 'undefined') {
Copy link
Contributor

Choose a reason for hiding this comment

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

/nit != null checks are usually preferred in the codebase from what I can tell

return context;
}

if (typeof visit !== 'function' && visit.exit) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We assign enter to a const up on line 545 - any reason we don't do the same for exit? I'm guessing a typeof isn't a huge overhead anyway..

@yamadapc yamadapc enabled auto-merge (squash) April 22, 2024 05:41
@yamadapc yamadapc merged commit db2984d into parcel-bundler:v2 Apr 22, 2024
16 of 17 checks passed
@devongovett
Copy link
Member

Do you have performance numbers for this? Where did this work come from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants