Skip to content

Code Quality: Improve CommandManager#18163

Merged
yair100 merged 1 commit intofiles-community:mainfrom
KrisVandermotten:CommandManager
Feb 17, 2026
Merged

Code Quality: Improve CommandManager#18163
yair100 merged 1 commit intofiles-community:mainfrom
KrisVandermotten:CommandManager

Conversation

@KrisVandermotten
Copy link
Contributor

Resolved / Related Issues

Steps used to test these changes

  1. Inspect the generated files, and compare them to the previously generated files
  2. Run Files and use commands

@yair100 yair100 requested a review from 0x5bfa February 16, 2026 00:35
@yair100 yair100 added the ready for review Pull requests that are ready for review label Feb 16, 2026
@yair100
Copy link
Member

yair100 commented Feb 16, 2026

Thank you for the PR.

Copy link
Member

@0x5bfa 0x5bfa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This looks to be incremental now.

@KrisVandermotten
Copy link
Contributor Author

This looks to be incremental now.

It is indeed.

Do you want me to update the StringBuilder logic in StringsPropertyGenerator using raw strings too (in a separate PR, obviously)?

@yair100
Copy link
Member

yair100 commented Feb 16, 2026

Does this have a positive impact on startup performance?

@0x5bfa
Copy link
Member

0x5bfa commented Feb 16, 2026

Generators run on VS threads at compilation time, no.

Do you want me to update the StringBuilder logic in StringsPropertyGenerator using raw strings too (in a separate PR, obviously)?

I think it's already better.

@KrisVandermotten
Copy link
Contributor Author

I think it's already better.

I think it's indeed improved in this PR. But my question was about #18161, where I did not touch the StringBuilder code (yet). Do you want me to make a new PR, that improves that code similarly to the improvements here?

@KrisVandermotten
Copy link
Contributor Author

KrisVandermotten commented Feb 16, 2026

Does this have a positive impact on startup performance?

Not sure what you are referring to?

This PR does have a positive impact on startup performance. The newly generated code is more efficient than the previously generated code. Just to be clear, I have no plans for further changes to this PR.

On the other hand, changing the way in which the code is generated, i.e. replacing multiple calls to AppendLine by a single call to Append with a multiline raw string in the generator, has no impact on the generated code whatsoever. This is primarily about readability of the generating code. The generation is also slightly more efficient, but the generated code is the same. I already did this in this PR, but not (yet) in #18161.

@yair100
Copy link
Member

yair100 commented Feb 16, 2026

Thanks for confirming. Did you run any benchmarks to compare the difference in startup performance? If it's noticeable, I can include a mention in the next update changelog.

@yair100 yair100 added ready to merge Pull requests that are approved and ready to merge and removed ready for review Pull requests that are ready for review labels Feb 17, 2026
@yair100 yair100 merged commit 321b42f into files-community:main Feb 17, 2026
6 checks passed
@KrisVandermotten KrisVandermotten deleted the CommandManager branch February 17, 2026 05:49
@KrisVandermotten
Copy link
Contributor Author

I did not run any formal benchmark. Measuring cold startup time correctly is not exactly trivial.

I would not expect the speedup to be immediately noticeable with the naked eye. There are a lot of things going on during startup, and building the CommandManager is just one of them. You know, Amdahl's law.

@yair100
Copy link
Member

yair100 commented Feb 18, 2026

Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Pull requests that are approved and ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code Quality: Inefficiencies in CommandManager

3 participants

Comments