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.bat
and the files invendor/lib
) are full of calls tolib_console
for 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.