[SOLVED] MinGW - performance is degarding from linux version to win32 version
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
Using multimedia win32 timers fixed the problem. I've set some conditional compilation tags, replacing g_timeout_add() with timeSetEvent() for the win32 version and now it's fine. Really smooth and fast. Again, thanks a lot...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.