fix: fixed the bug about plugin duration calculate#91
Draft
CrabSAMA wants to merge 3 commits intovitejs:mainfrom
Draft
fix: fixed the bug about plugin duration calculate#91CrabSAMA wants to merge 3 commits intovitejs:mainfrom
CrabSAMA wants to merge 3 commits intovitejs:mainfrom
Conversation
…o calculate plugin cost time
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? |
Contributor
Author
|
Have some new opinion about calculate the working duration? Because this pr is still draft, maybe I need to finish it or drop it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
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.
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
PluginFlowTimelinealso need to display duration, now it make duplicate calculate duration, I think the duration value can transfer into byPluginDetailsLoader, in the past I liked to useprovide/inject, but I found this project never used it before, so should I transfer it by transparent transmission props?BuildMetricsalso 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?