Skip to content
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

Console writes are slower in standard CMD #2

Open
wbochar opened this issue Mar 25, 2020 · 1 comment
Open

Console writes are slower in standard CMD #2

wbochar opened this issue Mar 25, 2020 · 1 comment
Assignees
Labels
help wanted Extra attention is needed

Comments

@wbochar
Copy link

wbochar commented Mar 25, 2020

I've noticed that the Visual Studio CMD shell renders faster (significantly) than a published exe/dll on a standard CMD shell in Windows 10. If you create a shortcut link with the folder information it seems the console speeds up on the standard CMD.

@davidvontamar
Copy link
Owner

davidvontamar commented Jul 6, 2020

I can't test the Windows Command Prompt, and Visual Studio at the moment.
To make sure that it's not ANSITerm's fault, we need to check the environment variables these terminal emulators provide. We could compare ANSITerm's Console to standard Console only if the ENV variables signal ANSI escape code support, otherwise ANSITerm provides merely a facade to the standard .NET Console class, therefore does not affect performance or creates overhead in any possible way.

Note that if ANSI escape codes are indeed supported by the emulator, then there would be minor overhead for the cost of printing ANSI color & style escape codes. These are actual groups of invisible escaped characters that are printed to the standard output of the console application according to the ECMA-48 specification.

If you change styles/colors too frequently (as in every few characters) then it might affect printing performance, especially if there's a limited support for color, because ANSITerm needs to adjust your desired colors to the closest available color that the terminal in question could support (excluding colors it already converted since the application started running, there's a dictionary cache for previously adjusted colors for future use).

Can you elaborate with more information about the environment variables of the

  1. Windows Command Prompt (cmd.exe), or
  2. The new Windows Terminal (in case there's an overhead there, too).
  3. Visual Studio's built-in Terminal.

You can also run the Tamar.ANSITerm.Test console application with the said terminals, and send the command support to check if ANSITerm's Console is actually in effect or not.
image

@davidvontamar davidvontamar self-assigned this Jul 8, 2020
@davidvontamar davidvontamar added the help wanted Extra attention is needed label Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants