Printing unicode characters is about 20x slower than usual characters #20163

Closed
opened 2026-01-31 07:05:27 +00:00 by claunia · 6 comments
Owner

Originally created by @tigrouind on GitHub (Jun 28, 2023).

Windows Terminal version

1.17.11461.0

Windows build number

10.0.22621.1848

Other Software

using System;
using System.Diagnostics;

namespace ConsoleApp1
{
	internal class Program
	{
		static void Main()
		{
			Stopwatch sw = new Stopwatch();

			sw.Restart();
			for (int i = 0; i < 100; i++)
			{
				for (int j = 0; j < 100; j++)
				{
					Console.Write('.');
				}
				Console.WriteLine();
			}				
			sw.Stop();
			Console.WriteLine(sw.ElapsedMilliseconds);

			sw.Restart();
			for (int i = 0; i < 100; i++)
			{
				for (int j = 0; j < 100; j++)
				{
					Console.Write('▓');
				}
				Console.WriteLine();
			}
			sw.Stop();
			Console.WriteLine(sw.ElapsedMilliseconds);
		}
	}
}

Steps to reproduce

Print unicode characters to the console. Eg: U+2593 DARK SHADE

Here are benchmark results from C# application listed above.

Windows 11 Terminal (Ryzen 5700x / 1080TI GPU) :

Dot character : 108 ms
DARK SHADE : 2441 ms

Windows 10 command line (slower computer) :

Dot character : 311 ms
DARK SHADE : 314 ms

Expected Behavior

Rendering is just as fast as other characters

Actual Behavior

Rendering is very slow (it looks like it freeze temporarily when printing such characters).
Even after printing unicode characters, scrolling the area where they appear is slow.

Originally created by @tigrouind on GitHub (Jun 28, 2023). ### Windows Terminal version 1.17.11461.0 ### Windows build number 10.0.22621.1848 ### Other Software ```csharp using System; using System.Diagnostics; namespace ConsoleApp1 { internal class Program { static void Main() { Stopwatch sw = new Stopwatch(); sw.Restart(); for (int i = 0; i < 100; i++) { for (int j = 0; j < 100; j++) { Console.Write('.'); } Console.WriteLine(); } sw.Stop(); Console.WriteLine(sw.ElapsedMilliseconds); sw.Restart(); for (int i = 0; i < 100; i++) { for (int j = 0; j < 100; j++) { Console.Write('▓'); } Console.WriteLine(); } sw.Stop(); Console.WriteLine(sw.ElapsedMilliseconds); } } } ``` ### Steps to reproduce Print unicode characters to the console. Eg: `U+2593 DARK SHADE` Here are benchmark results from C# application listed above. Windows 11 Terminal (Ryzen 5700x / 1080TI GPU) : > Dot character : 108 ms > DARK SHADE : 2441 ms Windows 10 command line (slower computer) : > Dot character : 311 ms > DARK SHADE : 314 ms ### Expected Behavior Rendering is just as fast as other characters ### Actual Behavior Rendering is very slow (it looks like it freeze temporarily when printing such characters). Even after printing unicode characters, scrolling the area where they appear is slow.
claunia added the Issue-BugResolution-Duplicate labels 2026-01-31 07:05:27 +00:00
Author
Owner

@lhecker commented on GitHub (Jun 28, 2023):

Before I debug this, could you try and see if it improves if you enable "AtlasEngine" in the "Rendering" settings? After enabling it you'll have to restart the application or create new tabs.

@lhecker commented on GitHub (Jun 28, 2023): Before I debug this, could you try and see if it improves if you enable "AtlasEngine" in the "Rendering" settings? After enabling it you'll have to restart the application or create new tabs.
Author
Owner

@DHowett commented on GitHub (Jun 28, 2023):

It might also be worth testing your workload in Windows Terminal Preview v1.18 (don't worry, it doesn't overwrite your existing terminal install) as well. We've been working on the backing buffer and rendering performance for Unicode 😄

You can still try this, but this isn't "non-BMP unicode" so it is less likely to be impacted by the TextBuffer changes!

@DHowett commented on GitHub (Jun 28, 2023): ~~It might also be worth testing your workload in [Windows Terminal Preview v1.18](https://aka.ms/terminal-preview) (don't worry, it doesn't overwrite your existing terminal install) as well. We've been working on the backing buffer _and_ rendering performance for Unicode :smile:~~ You can still try this, but this isn't "non-BMP unicode" so it is less likely to be impacted by the TextBuffer changes!
Author
Owner

@tigrouind commented on GitHub (Jun 28, 2023):

Before I debug this, could you try and see if it improves if you enable "AtlasEngine" in the "Rendering" settings? After enabling it you'll have to restart the application or create new tabs.

I didn't know such parameters existed. It improves performance a lot. Here are the results :

Non unicode : 112ms
Unicode : 109ms

The "Use software rendering" option also improves performance (but Unicode is still a little slower):

Non unicode : 116ms
Unicode : 210ms

@tigrouind commented on GitHub (Jun 28, 2023): > Before I debug this, could you try and see if it improves if you enable "AtlasEngine" in the "Rendering" settings? After enabling it you'll have to restart the application or create new tabs. I didn't know such parameters existed. It improves performance a lot. Here are the results : > Non unicode : 112ms > Unicode : 109ms The "Use software rendering" option also improves performance (but Unicode is still a little slower): > Non unicode : 116ms > Unicode : 210ms
Author
Owner

@tigrouind commented on GitHub (Jun 28, 2023):

It might also be worth testing your workload in Windows Terminal Preview v1.18 (don't worry, it doesn't overwrite your existing terminal install) as well. We've been working on the backing buffer and rendering performance for Unicode 😄

You can still try this, but this isn't "non-BMP unicode" so it is less likely to be impacted by the TextBuffer changes!

I've tried it and it's just as fast as "AtlasEngine".

@tigrouind commented on GitHub (Jun 28, 2023): > ~It might also be worth testing your workload in [Windows Terminal Preview v1.18](https://aka.ms/terminal-preview) (don't worry, it doesn't overwrite your existing terminal install) as well. We've been working on the backing buffer _and_ rendering performance for Unicode 😄~ > > You can still try this, but this isn't "non-BMP unicode" so it is less likely to be impacted by the TextBuffer changes! I've tried it and it's just as fast as "AtlasEngine".
Author
Owner

@lhecker commented on GitHub (Jun 28, 2023):

I'm glad AtlasEngine fixes the issue. Windows Terminal Preview already has it enabled by default. We plan to make it the default option in non-Preview in version 1.18 or 1.19.

I'll close the issue as a duplicate of #6974 then. /dup #6974

@lhecker commented on GitHub (Jun 28, 2023): I'm glad AtlasEngine fixes the issue. Windows Terminal Preview already has it enabled by default. We plan to make it the default option in non-Preview in version 1.18 or 1.19. I'll close the issue as a duplicate of #6974 then. /dup #6974
Author
Owner

@microsoft-github-policy-service[bot] commented on GitHub (Jun 28, 2023):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@microsoft-github-policy-service[bot] commented on GitHub (Jun 28, 2023): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20163