UString methods

Forum where anything UOX3-related goes - including, but not limited to: newbie-support, ideas, general questions, comments, etc and-so-forth.
Post Reply
punt
VIP
Posts: 244
Joined: Wed Mar 24, 2004 7:46 pm
Has thanked: 0
Been thanked: 9 times

UString methods

Post 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.
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post 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.
Post Reply