Skip to content

Conversation

CrabSAMA
Copy link
Contributor

Problem

img_v3_02pi_fa6f2f3d-ce98-4e9d-ac0f-395cc88658dg

When I used devtools to analyze real project, I found the abnormal case about time duration display. This time is not possible to be so long! 😱

And so on I found duration is calculate by add together currently, adding time simply is incorrect because multiple files may be processed and multiple hooks may be run at the same time. This is a classical question about merge nearby time section.

After I fixed it, the duration seen normally, and I try to manual calculation also meets expectations.

image

But now this pr is wip, because I have some question, after got answer I will finish it and make it can be merged.

Question

  • Component PluginFlowTimeline also need to display duration, now it make duplicate calculate duration, I think the duration value can transfer into by PluginDetailsLoader, in the past I liked to use provide/inject, but I found this project never used it before, so should I transfer it by transparent transmission props?
  • Component BuildMetrics also display duration, plugin run duration is wrong obviously, but I don't know the single module time duration Is right or wrong, because I know plugin have parallel running, but IMO file is be handled by serial, so should I modify the duration calculate logic about module?

@CrabSAMA CrabSAMA marked this pull request as draft August 27, 2025 12:14
@CrabSAMA CrabSAMA marked this pull request as ready for review August 27, 2025 12:15
@CrabSAMA CrabSAMA marked this pull request as draft August 27, 2025 12:15
@webfansplz
Copy link
Member

At the beginning, this time was calculated based on the working duration of the plugin (See 61d7f4f). After discussing with Anthony, we decided to use the total duration to calculate the overhead of a plugin. In real projects, the total duration does seem a bit excessive. /cc @antfu , what do you think about this?

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.

2 participants