From 6187aa0b1bfcba7e5d956e05685ad1de42666221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 15 Jun 2021 08:44:52 +0200 Subject: [PATCH] term: lower maximum number of characters in a compose chain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before the grapheme cluster segmentation work, we limited the number of combining characters to base+5. I.e. 6 in total. For a while now, we’ve had it bumped all the way up to 20. This was the reason the unicode-random benchmark ran so much slower (i.e. cache contention). Looking at emoji’s, there are a couple that need 6 code points, and *three* that needs 7. Now, with the limit at 7 chars, and the new ‘width’ member, the composed struct is 8 bytes larger than before. --- terminal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminal.h b/terminal.h index 83406f41..307e2b0b 100644 --- a/terminal.h +++ b/terminal.h @@ -85,7 +85,7 @@ struct damage { }; struct composed { - wchar_t chars[20]; + wchar_t chars[7]; uint8_t count; int width; };