Mageia Bugzilla – Attachment 1564 Details for
Bug 2775
When launching MageiaUpdate, /etc/X11/X eats 80% of the CPU for more than a minute, leaving the system mostly unresponsive
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
do not flush more than 3 times a second
less-flushing.diff (text/plain), 749 bytes, created by
Thierry Vignaud
on 2012-02-15 18:53:59 CET
(
hide
)
Description:
do not flush more than 3 times a second
Filename:
MIME Type:
Creator:
Thierry Vignaud
Created:
2012-02-15 18:53:59 CET
Size:
749 bytes
patch
obsolete
>--- /usr/lib/perl5/vendor_perl/5.14.2/Rpmdrake/gurpm.pm 2012-02-15 17:29:55.764160802 +0000 >+++ /usr/lib/perl5/vendor_perl/5.14.2/Rpmdrake/gurpm.pm 2012-02-15 17:37:36.254715532 +0000 >@@ -28,6 +28,8 @@ > use mygtk2 qw(gtknew); #- do not import anything else, especially gtkadd() which conflicts with ugtk2 one > use ugtk2 qw(:all); > use base qw(ugtk2); >+use Time::HiRes; >+use feature 'state'; > > > sub new { >@@ -61,9 +63,12 @@ > > sub progress { > my ($self, $fraction) = @_; >+ state $time; > $fraction = 0 if $fraction < 0; > $fraction = 1 if 1 < $fraction; > $self->{progressbar}->set_fraction($fraction); >+ return if Time::HiRes::clock_gettime() - $time < 0.333; >+ $time = Time::HiRes::clock_gettime(); > $self->flush; > } >
--- /usr/lib/perl5/vendor_perl/5.14.2/Rpmdrake/gurpm.pm 2012-02-15 17:29:55.764160802 +0000 +++ /usr/lib/perl5/vendor_perl/5.14.2/Rpmdrake/gurpm.pm 2012-02-15 17:37:36.254715532 +0000 @@ -28,6 +28,8 @@ use mygtk2 qw(gtknew); #- do not import anything else, especially gtkadd() which conflicts with ugtk2 one use ugtk2 qw(:all); use base qw(ugtk2); +use Time::HiRes; +use feature 'state'; sub new { @@ -61,9 +63,12 @@ sub progress { my ($self, $fraction) = @_; + state $time; $fraction = 0 if $fraction < 0; $fraction = 1 if 1 < $fraction; $self->{progressbar}->set_fraction($fraction); + return if Time::HiRes::clock_gettime() - $time < 0.333; + $time = Time::HiRes::clock_gettime(); $self->flush; }
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2775
: 1564 |
1740
|
1741