Re: gtk-app-devel-list Digest, Vol 3, Issue 27



W liście z pon, 19-07-2004, godz. 18:17, Dave Andruczyk pisze: 

I am NOT using a pixmap based theme.  Using one makes the problem MUCH MUCH
worse...  I am trying to update 12-15 progressbars about 20 times per second
for a realtime readout.  That will easily max the CPU of my 366 mhz laptop and
use up to 40% of the cpu of my dual athlon 1200 main system.

That's just plain unacceptable.  I could draw a rectangle 1 pixel at a time and
use less cpu than that...

Running this python app:

import gtk

class Idler:
    def __init__(self):
        self.i = 0.01
    def spin(self, pbars):
        for n in range(len(pbars)):
            pbars[n].set_fraction(self.i)
        self.i += 0.01
        if self.i > 1:
            self.i = 0.01
        return True


pbars = []
window = gtk.Window()
vbox = gtk.VBox()
window.add(vbox)
window.connect("delete-event", lambda a,b: gtk.main_quit())

for n in range(12):
    pbars.append(gtk.ProgressBar())
    vbox.add(pbars[n])

idl=Idler()
gtk.timeout_add(50, idl.spin, pbars)

window.show_all()
gtk.main()

with default GNOME theme, I get less than 10% CPU usage on my Athlon 2K
system. Even with my pixmap theme, I don't get more than 45-50%. And
given CPU meter applet precision, 10% is on the edge of statistical
error. It shouldn't burden your system that much, I don't believe my
system is over 4x faster than your dual Athlon 1k2.

Cheers,
Maciej

-- 
"Tautologizm to coś tautologicznego"
   Maciej Katafiasz <mnews2 wp pl>
       http://mathrick.blog.pl




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]