You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove dead code from SemanticVersion class. It was added pending the development of semantic version story but we got no feedback and no progress. Currently we are waiting .Net for the story.
The PR speeds up startup scenario on my laptop up to 50 ms.
If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.
@daxian-dbw@rjmholt Could you please explain how the public static implicit operator Version(SemanticVersion semver) works? Original code defines PSObject psobj and not return it - looks like dead code. But if I remove it tests fail which means that the original code still implicitly returns PSObject!
Update: looks like a tricky bug in .Net Runtime. :-(
@iSazonovpsobj.Properties.Add adds the member to s_instanceMembersResurrectionTable, which allows PowerShell to retrieve the ETS members for the specific object, the System.Version result here, when access that object in PowerShell later. Put it another way, psobj.Properties.Add makes PowerShell remember that an instance member is added for the particular object result.
This code path shouldn't be removed. It's the reason why you see the following from a System.Verseion object.
PS C:\> $PSVersionTable.PSCompatibleVersions[-1]
Major Minor Build Revision PSSemVerPreReleaseLabel PSSemVerBuildLabel
----- ----- ----- -------- ----------------------- ------------------
7 2 0 -1 preview.1
Besides, this particular impact won't affect stable versions, because PSSemVerPreReleaseLabel and PSSemVerBuildLabel are null for stable versions. When profiling, I recommand you to build PowerShell with -ReleaseTag v7.2.0, so as to mimic a stable version.
@daxian-dbw Thanks for clarify!
I was sure that we left this code only as "want get a feedback" and till .Net solution comes.
Based on our experience in PowerShell I shared in .Net proposal to enhance System.Version type instead of creating new .Net SemanticVersion class. If this will be implemented in any way we will fall in a breaking change so we can close the PR and add more in our documentation about PowerShell SemanticVersion class.
When profiling, I recommand you to build PowerShell with -ReleaseTag v7.2.0, so as to mimic a stable version.
I see your point but:
Modern live cycle development model assumes preview versions is stable enough and works as well as release. Users actively use Preview versions. I believe they shouldn't disappoint users and behave as well as releases.
It also allows us to get reliable performance feedback early on, rather than after the final release.
In SemanticVersion context PSSemVerPreReleaseLabel is null for stable version but PSSemVerBuildLabel could be not null - ex.: if we re-packaged we could increase the build label as SemVer standard says.
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
CL-PerformanceIndicates that a PR should be marked as a performance improvement in the Change Log
2 participants
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.
PR Summary
Remove dead code from SemanticVersion class. It was added pending the development of semantic version story but we got no feedback and no progress. Currently we are waiting .Net for the story.
The PR speeds up startup scenario on my laptop up to 50 ms.
PR Context
Related #14268
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.