Re: Code Page problem in SetWindowText
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Thu, 06 Sep 2007 01:17:21 -0400
I've had lots of people insist that it is faster to use ANSI apps because "the strings are
shorter". They don't realize that since all of WIndows is written in Unicode, every ANSI
API has to first convert its arguments to Unicode, then call the Unicode version of the
API, so ANSI would be inherently slower.
In an experiment I ran, Unicode is on the average slightly faster than ANSI, for something
as simple as a repeated SetWindowText, although the variance of the samples is high.
joe
On Thu, 6 Sep 2007 01:37:34 +0200, "Giovanni Dicanio" <giovanni.dicanio@xxxxxxxxxx> wrote:
Joseph M. Newcomer [MVP]
"Tom Serface" <tom.nospam@xxxxxxxxxxxxx> ha scritto nel messaggio
news:OIPsKEB8HHA.5212@xxxxxxxxxxxxxxxxxxxxxxx
That's a really good point. I hadn't thought of that before. So I guess
if you are moving strings in and out of controls a lot there could even be
a performance improvement using Unicode.
Hi Tom,
I completely agree with this analysis by David, at least on the (real)
operating systems like Win2K/XP/Vista, that are Unicode-native.
(Win9x "toys" are a different thing, maybe there ANSI is faster than
Unicode, because they are ANSI/MBCS-native, but the Win9x family is not
interesting for me.)
G
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: Code Page problem in SetWindowText
- From: Tom Serface
- Re: Code Page problem in SetWindowText
- From: Giovanni Dicanio
- Re: Code Page problem in SetWindowText
- References:
- Code Page problem in SetWindowText
- From: Marco Hung
- Re: Code Page problem in SetWindowText
- From: Mihai N.
- Re: Code Page problem in SetWindowText
- From: Tom Serface
- Re: Code Page problem in SetWindowText
- From: David Ching
- Re: Code Page problem in SetWindowText
- From: Tom Serface
- Re: Code Page problem in SetWindowText
- From: Giovanni Dicanio
- Code Page problem in SetWindowText
- Prev by Date: VPN
- Next by Date: Re: VPN
- Previous by thread: Re: Code Page problem in SetWindowText
- Next by thread: Re: Code Page problem in SetWindowText
- Index(es):
Relevant Pages
|