MinGW - performance is degarding from linux version to win32 version
Hi everybody!
I've made a linux app that I'm porting to win32 winth MinGW and MSYS. It's a ticker app that reads then renders a text file to a pixmap (a tall single-line image), then it kind of scrolls the pixmap by drawing a part of it to a drawing_area, using gdk_draw_drawable() within a timeout handler set by g_timeout_add(). The problem is it works fine on linux (the scrolling is really smooth and that's the goal) but the win version is choppy and uses at least 90% of cpu resources (vs 15% with linux) like there is a big performance problem. And I'm not even sure that double buffering is set. Does anyone have an clue? Is it related to some mingw config or drawing_area stuff or gtk for win? Thank you. Manu Thomas-Maurin |
Try compling the program with -ffast-math.
|
Thanks a lot. I also found that setting process priority to high helps as well. So it's really smooth now. But it's like there is still a "scrolling speed limit" in windows. The image is supposed to be refreshed every interval milliseconds with g_timeout_add(interval,callback,data). With linux I can scroll really fast if I set interval under about 15 ms, but with windows it doesn't make any difference between 15 and 1. Like I can't override a control thing... (but that's windows, not much user control!)
Thanks again anyway. Manu Thomas-Maurin |
Normal windows XP timers have a maximum resolution of 15 ms. You need to use the 'high resolution' timers. I don't know if gtk supports this, but it's probably in use by sound or video apis.
|
Thanks! I'm gonna check this and I will let you know.
|
Quote:
|
All times are GMT -5. The time now is 03:52 PM. |