Page 1 of 1

UString methods

Posted: Wed Jun 30, 2004 12:23 am
by punt
I don't know how widespread UStirng is in UOX. But one thing it does is pass its parameters on most of its methods by value. This is clearly not the most effeicent for 90% of its calls. One may want to consider optimzing it a tad, if in widespread use by adding a reference (&) to the calls. However, ensure it doesn't modify the variable in the method.

Posted: Wed Jun 30, 2004 2:27 am
by Maarc
While it may not be the most efficient way, it certainly isn't too bad. I ran a quick and dirty comparison a while back, and at least under release, it's only marginally slower to startup, where most of the UString stuff would occur (and it really was marginal). Under debug, it's slower definitely, but VC seems to manage (at least at 7.1) to get a lot of speed out of it.

There are 562 references to UString in the source code. Some will be in its implementation, others in comment lines, but it is quite widespread now. More references to UString than char *, by 2:1.