Improve init speed#2430
Merged
daxgames merged 2 commits intocmderdev:masterfrom Dec 11, 2020
kaimac1:faster-init
Merged
Conversation
Member
|
I will take a look. I already have a branch I am working on the gets rid of everything in |
Member
Contributor
Author
|
Oops, that last commit should fix things. The "if" errors were coming from the delayed expansion "!print_debug!" calls. I've replaced them with %print_debug% as I can't see why the expansion would change - hopefully you can confirm that's ok. |
Member
Member
|
Thanks for the PR - Merged |
Contributor
Author
|
Thanks for maintaining cmder! I look forward to your even faster version. |
Contributor
|
Unfortunately, this is having a side effect: If the |
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.




Hello,
The init scripts (
init.batand the files invendor/lib) are full of calls tolib_consolefor debug/verbose logging. Unfortunately these calls have a cost which adds up to quite a lot. The reason is that doing e.g.%lib_console% debug_output ....invokescall, which is relatively slow. This cost is paid even if debug/verbose logging is turned off, which of course it is most of the time.I have replaced such lines with
%print_debug%/%print_verbose%instead, which first check that the relevant flag is set. I have added%print_error%for consistency, though this doesn't give any performance improvement. The original way to print,%lib_console% debug_output ...still works in case it's used somewhere else.On my machine, without this change, the latest version of cmder_mini takes 1.41 sec on average to init (measured with time_init flag). With the change it takes 1.02 sec, so almost a 30% improvement.