Just wondered to confirm if this is a known issue and discuss any possible workarounds.
I have a application that loops through (about 100+ times) and draws a custom widget. On Windows and linux it works fine, however on Mac there is a significant delay. I ran a profiler on it, and this popped up:
gyazo.com/c79def99df1d42442eb38ee4cf7149b9 for mac, compare with http://gyazo.com/588299bb9615157b87802dcd41beee42 for windows
Is there a known work around? I’m thinking to just declare the different fonts we use early in the application once and just use them as needed.
Just wondered to confirm if this is a known issue and discuss any possible
workarounds.
gyazo.com/c79def99df1d42442eb38ee4cf7149b9 for mac, compare with
Screenshot - 588299bb9615157b87802dcd41beee42 - Gyazo for windows
Interesting. I haven't noticed that, but then again, never had to make a
lot of custom fonts on the fly either.
Is there a known work around? I'm thinking to just declare the different
fonts we use early in the application once and just use them as needed.
That's probably the way to go, yes.
It's possible that there is a bug making this expensive, but some things
are just done differently on different platforms.
Another option wold be to create a font cache -- you ask it to make the
font for you, and it gives you back an already cached one if it's the same
as one previously used. My guess is that you use the same font a lot at any
given time in the app. If you are worried about keeping around ones that
will never be used again, there are a umber of LRU cache implementations
floating around the web.
-Chris
···
On Thu, Dec 11, 2014 at 6:52 PM, Ryan Holmes <ryan.xgamer99@gmail.com> wrote:
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov