summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-09-18 22:46:49 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-09-18 22:46:49 +0000
commit572677326167d3325714beee743d3d263f4f62fe (patch)
tree88f861661a2dcf1d8477488e7f9769f5e793e480
parent9f78dc1be419fc7ee7eef01dde2474a5c3fb7900 (diff)
downloaddrakx-572677326167d3325714beee743d3d263f4f62fe.tar
drakx-572677326167d3325714beee743d3d263f4f62fe.tar.gz
drakx-572677326167d3325714beee743d3d263f4f62fe.tar.bz2
drakx-572677326167d3325714beee743d3d263f4f62fe.tar.xz
drakx-572677326167d3325714beee743d3d263f4f62fe.zip
tentative to correct install time for big installs
-rw-r--r--perl-install/install_steps_gtk.pm13
-rw-r--r--perl-install/pkgs.pm14
2 files changed, 24 insertions, 3 deletions
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 088f3b0ba..9011b0fbd 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -551,18 +551,25 @@ sub installPackages {
my $p = pkgs::packageByName($o->{packages}, $name);
$last_size = c::headerGetEntry(pkgs::packageHeader($p), 'size');
$text->set((split /\n/, c::headerGetEntry(pkgs::packageHeader($p), 'summary'))[0] || '');
- $advertize->(1) if $show_advertising && $total_size > 20 * sqr(1024) && time() - $change_time > 20;
+ $advertize->(1) if $show_advertising && $total_size > 20_000_000 && time() - $change_time > 20;
$w->flush;
} elsif ($m =~ /^Progressing installing package/) {
$progress->update($_[2] ? $_[1] / $_[2] : 0);
my $dtime = time() - $start_time;
- my $ratio = $total_size ? ($_[1] + $current_total_size) / $total_size : 0; $ratio >= 1 and $ratio = 1;
+ my $ratio =
+ $total_size == 0 ? 0 :
+ pkgs::size2time($current_total_size + $_[1], $total_size) / pkgs::size2time($total_size, $total_size);
+ $ratio >= 1 and $ratio = 1;
my $total_time = $ratio ? $dtime / $ratio : time();
+#- my $ratio2 = $total_size == 0 ? 0 : ($current_total_size + $_[1]) / $total_size;
+#- log::l(sprintf("XXXX advance %d %d %s", $current_total_size + $_[1], $dtime, formatTimeRaw($total_time)));
+
$progress_total->update($ratio);
- if ($dtime != $last_dtime && $current_total_size > 10 * sqr(1024)) {
+ if ($dtime != $last_dtime && $current_total_size > 80_000_000) {
$msg_time_total->set(formatTime(10 * round($total_time / 10) + 10));
+#- $msg_time_total->set(formatTimeRaw($total_time) . " " . formatTimeRaw($dtime / $ratio2));
$msg_time_remaining->set(formatTime(10 * round(max($total_time - $dtime, 0) / 10) + 10));
$last_dtime = $dtime;
}
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index f4fc3d3b0..9f097156f 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -165,6 +165,20 @@ sub selectedSize {
}
sub correctedSelectedSize { correctSize(selectedSize($_[0]) / sqr(1024)) }
+sub size2time {
+ my ($x, $max) = @_;
+ my $A = 7e-07;
+ my $limit = min($max * 3 / 4, 9e8);
+ if ($x < $limit) {
+ $A * $x;
+ } else {
+ $x -= $limit;
+ my $B = 6e-16;
+ my $C = 15e-07;
+ $B * $x ** 2 + $C * $x + $A * $limit;
+ }
+}
+
#- searching and grouping methods.
#- package is a reference to list that contains