Skip to content

Finish Modules steps tooks long time #17752

@JiangWeixian

Description

@JiangWeixian

Currently, I develop a huge react project with

  • webpack@5.85.1.
  • Apple M1 Max

When edit some files to trigger HMR, in progress plugin output, finishModules step tooks long time. So I add https://github.com/jantimon/cpuprofile-webpack-plugin to find out which step cost a lot, here is cpu profile screenshot:

image

image

Any ideas to optimize it? I already tried:

  1. [Build Performance] chunk graph very much slow #8557 replace dynamic import to promise.resolve
  2. disable cache and progress in dev mode

It does't help. But when I comments sortItemsWithChunkIds inside Compliation.js, e.g.

// this.sortItemsWithChunkIds();

It make finish module step from 7s to 2s.

Originally posted by @JiangWeixian in #17751

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions