|
From: | Paolo Bonzini |
Subject: | Re: uc_width and wcwidth optimization |
Date: | Thu, 15 Dec 2011 16:50:33 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 |
On 12/13/2011 11:32 AM, Bruno Haible wrote:
I'm attaching the benchmark program I'm experimenting with. So far, it seems that locale_charset() is really slow, whereas the is_cjk stuff is not a big speed problem. I would love to have locale_charset be either faster or use some thread-safe cache. Do you have an idea how to realize this?
You can add a uc_width_internal that takes the encoding plus an int *. The pointed value can be "-1" for no cache, "0" for cached not CJK, "1" for cached CJK.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |