aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-02-23 15:22:21 +0000
committerThierry Vignaud <tv@mandriva.org>2009-02-23 15:22:21 +0000
commit2b35cecf47fa383d8ec0f113196a34c63f63183a (patch)
tree9c5900d4aae339e856314dda259fe0bcddbd5aea
parent5a19508fadf2d7c6f83a9a983f4801fc7570f59d (diff)
downloadrpmdrake-2b35cecf47fa383d8ec0f113196a34c63f63183a.tar
rpmdrake-2b35cecf47fa383d8ec0f113196a34c63f63183a.tar.gz
rpmdrake-2b35cecf47fa383d8ec0f113196a34c63f63183a.tar.bz2
rpmdrake-2b35cecf47fa383d8ec0f113196a34c63f63183a.tar.xz
rpmdrake-2b35cecf47fa383d8ec0f113196a34c63f63183a.zip
(get_pkgs,get_summary) slightly reduce memory usage by not keeping around
summaries (2.1% of resident memory saved on std x86_64 media config)
-rw-r--r--Rpmdrake/gui.pm1
-rw-r--r--Rpmdrake/pkg.pm6
2 files changed, 3 insertions, 4 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm
index 3f0ac5e7..40334a42 100644
--- a/Rpmdrake/gui.pm
+++ b/Rpmdrake/gui.pm
@@ -100,6 +100,7 @@ sub compute_main_window_size {
sub get_summary {
my ($key) = @_;
+ $pkgs->{$key}{summary} ||= $pkgs->{$key}{pkg}->summary;
my $summary = translate($pkgs->{$key}{summary});
utf8::valid($summary) ? $summary : ();
}
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index f4a61909..37aca9a5 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -334,7 +334,6 @@ sub get_installed_packages {
#- Extract summary and description since they'll be lost when the header is packed
$all_pkgs->{$fullname} = {
selected => 0, pkg => $pkg, urpm_name => urpm_name($pkg),
- summary => $pkg->summary,
description => rpm_description($pkg->description),
} if !($all_pkgs->{$fullname} && $all_pkgs->{$fullname}{description});
if (my $name = $base{$fullname}) {
@@ -499,7 +498,7 @@ sub get_pkgs {
$pkg->flag_upgrade or next;
my $name = urpm_name($pkg);
push @installable_pkgs, $name;
- $all_pkgs{$name} = { pkg => $pkg, summary => $pkg->summary };
+ $all_pkgs{$name} = { pkg => $pkg };
}
foreach my $medium (@search_medias) {
update_pbar($gurpm);
@@ -509,7 +508,7 @@ sub get_pkgs {
$pkg->flag_upgrade or next;
my $name = urpm_name($pkg);
push @backports, $name;
- $all_pkgs{$name} = { pkg => $pkg, summary => $pkg->summary };
+ $all_pkgs{$name} = { pkg => $pkg };
}
}
foreach my $medium (@update_medias) {
@@ -526,7 +525,6 @@ sub get_pkgs {
push @updates, $name;
}
$all_pkgs{$name} = { selected => $selected, pkg => $pkg,
- summary => $pkg->summary,
};
}
}