rocklee has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks!
I have been playing around with Tk and more specifically Tk::Zinc lately (718496); the way I understand it Tk::Zinc uses OpenGL (with -render=>1 of course), so the systems GPU should be doing the heavy lifting, right?
But doing a mouse drag on a Tk::Zinc (or, indeed, a regular canvas) uses a lot of CPU on my system, even with trivial <Motion> callbacks. Is this a known problem? Could it be an issue with my system?
I have a simple item that can be dragged with mouse on a fullscreen canvas/zinc. I grab it and drag it back and forth like a maniac.
Difference in CPU usage is not immediately visible on different resolutions, i.e. 1280x1024 is no better than 1920x1200.
Also, dragging a windowed Perl/Tk app with a packed zinc widget around uses much more CPU than dragging any other kind of window (double that of Perl/Tk without zinc). For comparison dragging a running 720p running mplayer window in the same fashion uses much less (~10%) cpu than dragging a simple rectangle within a pTk app (~20%), and certainly less than dragging a rectangle within Tk::Zinc (~50%).
My laptop is dual core 2ghz (intel), I think it should be sufficient to drag a rectangle..;-) I run latest ubuntu with default perl packages, everything else built from CPAN. Is it possible that compiling perl from source may help on this issue? Or is there simply nothing to do? :-\
This is a problem for me because I plan on doing important things in the background. I don't want to risk losing a lot of cycles to mouse movement.Linux pvp 2.6.24-21-rt #1 SMP PREEMPT RT Mon Aug 25 19:24:40 UTC 2008 i686 GNU/Linux
This is perl, v5.8.8 built for i486-linux-gnu-thread-multi
Thanks in advance.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Tk/Zinc mouse drag performance issues?
by zentara (Cardinal) on Oct 25, 2008 at 13:39 UTC | |
by rocklee (Beadle) on Oct 25, 2008 at 14:31 UTC | |
by zentara (Cardinal) on Oct 25, 2008 at 17:23 UTC |