| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
PoshChan-Bot (@PoshChan) Please remind me in 4 hours. |
Sorry, something went wrong.
|
Hello Aditya Patwardhan (@adityapatwardhan)! Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass. Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 24 hours, a condition that will be fulfilled in about 4 hours 7 minutes. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here. |
Sorry, something went wrong.
|
Aditya Patwardhan (@adityapatwardhan), this is the reminder you requested 4 hours. ago |
Sorry, something went wrong.
|
🎉v7.0.0-preview.6 has been released which incorporates this pull request.:tada: Handy links: |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Summary
Avoid using closure in Parser.SaveError.
Context
Generally, Parser.SaveError shouldn't be called too frequently in production, because the script running in production should have been correct and generate no parsing error.
However, I saw the following call stack in Azure Profiler Viewer for PowerShell Gallery-Prod service:
Parser.SaveError takes about 43.56% of the CPU activities in the web server process w3wp.exe, and the call originates from NuGetGallery.Views.ScriptParsingAndHighlighting!Parse
Given the finding, I took a look at the implementation of Parser.SaveError and notice that it's using closure and LINQ unnecessarily. Especially, the closure use will cause allocation every time this method is called.
As for why PowerShellGallery triggers so many parsing errors, it's because it's parsing non-powershell files using powershell parser, which is wrong and will be fixed.
PR Checklist