-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance of lsif generation. #51457
Conversation
Is there an easy way I can run the generator locally? |
I'm running:
Note: you'll need #51458 where i add support for just running against a single project. i can also collect full solution time. |
Performance at the full solution goes from: Total time spent in the generation phase for all projects, including compilation fetch time: 523.66 seconds to Total time spent in the generation phase for all projects, including compilation fetch time: 464.94 seconds Only 12% gain here, but still nice to have. |
@@ -2,12 +2,14 @@ | |||
// The .NET Foundation licenses this file to you under the MIT license. | |||
// See the LICENSE file in the project root for more information. | |||
|
|||
using System.Collections.Generic; | |||
using Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.Graph; | |||
|
|||
namespace Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.Writing | |||
{ | |||
internal interface ILsifJsonWriter | |||
{ | |||
void Write(Element element); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❔ Do we still need this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup. several callers call directly into that one. I could have them wrap into a single-element list, but it seemed wasteful :)
You'll get at least 60 seconds gain my moving from MSBuildWorkspace to direct creation of compilations from csc invocations in the binlog. MSBuildWorkspace is extremely terrible for end-to-end performance because there is no parallelism in the MSBuild evaluation. csc invocations have a secondary benefit of improved accuracy. |
Definitely agree. I'm just very limited on time to here :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-approval
We would often write out tens of thousands of elements per file, taking locks for each eleemnt we're writing. We can just take the lock once and write out the full batch.
Before time:
After time:
This is an improvement of 25%.