Karen,
I ran into something similar with RealeWriter a few years ago. For
starters, make sure you turn background tasks off in your word-
wrapping routine.
Second thing is that caching the lines will help a lot. I had
TextBlock and TextLine classes and kept my own style arrays for each
character in the TextBlock, rather than run arrays.
If you really suspect the graphics class methods, like StringWidth,
make a wrapper method and profile. e.g.
function MyStringWidth(extends g as graphics, s as string) returns
integer
return g.StringWidth(s)
end function
Hope that helps.
-Brad
On Jun 30, 2010, at 8:11 PM, Karen wrote:
I have a routine that has a significant performance issue on OS X,
but flies on XP! What the routine does is wraps strings using RB
string functions and then uses g.DrawString to draw them.... and
this routine gets called a LOT!
Here is the profiler data for that routine doing about the same
thing on both platforms. Both are done on the same Mac with XP
running in Parallels.
Profiler Data:
OS Calls Total Ave Seconds %Total Time
Win XP 24018 0.73 0 4.1%
10.6.4 24137 54.72 0.0023 19.5%
It is a real bottleneck on OSX.
While i know Graphics are slower on OSX, how about RB string
functions (OR LOOPING)? Are they much slower on OSX than XP too?
If the cause is the actual drawing then there is nothing I can do...
If it's the string functions/wrapping I can (with significant work)
restructure my code to cache the wrapped strings and only rewrap
when needed, and not with every draw. (though that might slow other
things down because of extra levels of indirection so more
overriding with calls to superclass method after massaging etc)
Any ideas?
BTW I tried the to use g.UseOldRender = True, but doing that caused
a crash from the debug run into the OSX crash reporter. It looks
like you can't use that setting when using clipped graphics
regions.. they don't play nice... SO DO NOT DO THAT!!!
Thanks,
- Karen
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|