public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Justin <justin@j-schmitz.net>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Speed up with pbzip2  or not!?
Date: Sun, 27 Jan 2008 19:21:33 +0100	[thread overview]
Message-ID: <479CCBAD.4060707@j-schmitz.net> (raw)
In-Reply-To: <20080127172956.GA30818@nibiru.local>


Enrico Weigelt schrieb:
> * Florian Philipp <lists@f_philipp.fastmail.net> wrote:
>
> Hi folks,
>
>   
>> On Sun, 2008-01-27 at 11:40 +0100, Justin wrote:
>>     
>>> Is there a way to use 7zip for decompression with emerge?
>>>       
>> I fear, no easy one. Of course, since emerge is just a python script,
>> you could rewrite it but 7z-syntax isn't compatible with bzip2 or
>> gnu-tar so it will be some work. I also tried to use star as a drop-in
>> replacement for gnu-tar, once. Didn't work well although their syntax is
>> nearly identical, but just nearly...
>>     
>
> Why not an universal wrapper script ?
>
> maybe something like:
>
>     magic-uncompress [-t <format>] [-c] [-o <output>] <input>
>     
> This script could try to find out the input format automatically
> (the optional -t parameter allows to explicitly specifiy the format)
>
> Once we have this script, ebuilds could be rewritten step by step
> and no one (else than magic-uncompress) has to care about the actual 
> commands behind. 
>
> Some could be done w/ tar and zip, etc.
>
>
> cu
>   

But than there is still the incompability problem with pbzip2 with bzip2
compressed files. The best solution at this point would be to compress
all official tarballs with pbzip2, because now and  especially in future
parallel processing is the solution and second there is no problem
decompressing parallel compressed tarballs in single mode.


For an temporary work around I figured out this hack:

in /usr/lib/portage/bin/ebuild.sh there is a function defined for each
type of compression algorithm. I changed following lines

--- ebuild.sh.orig      2008-01-27 19:16:22.000000000 +0100
+++ ebuild.sh   2008-01-27 19:15:36.000000000 +0100
@@ -479,7 +479,7 @@
                                ;;
                        bz2|bz)
                                if [ "${y}" == "tar" ]; then
-                                       7za x -so "${srcdir}${x}" | tar
xof - ${tar_opts}
+                                       bzip2 -dc "${srcdir}${x}" | tar
xof - ${tar_opts}
                                        assert "$myfail"
                                else
                                        bzip2 -dc "${srcdir}${x}" >
${x%.*} || die "$myfail"

ebuild.sh.orig:
real    0m16.962s
user    0m16.289s
sys     0m2.780s


ebuild.sh:
real    0m12.805s
user    0m13.209s
sys     0m2.666s

With this trick you can change every kind of decompression command.

In this example you can save 25% of the time.
-- 
gentoo-user@lists.gentoo.org mailing list



      parent reply	other threads:[~2008-01-27 18:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-27  9:58 [gentoo-user] Speed up with pbzip2 or not!? Justin
2008-01-27 10:11 ` Dirk Heinrichs
2008-01-27 10:28   ` Justin
2008-01-27 10:49     ` Dirk Heinrichs
2008-01-27 10:58       ` Justin
2008-01-27 11:00         ` Justin
2008-01-27 10:16 ` Florian Philipp
2008-01-27 10:37   ` Justin
2008-01-27 12:54     ` Hemmann, Volker Armin
2008-01-27 19:07       ` Florian Philipp
2008-01-27 10:40 ` Justin
2008-01-27 11:33   ` Benno Schulenberg
2008-01-27 11:38   ` Florian Philipp
2008-01-27 17:29     ` Enrico Weigelt
2008-01-27 17:54       ` Bo Ørsted Andresen
2008-01-27 18:21       ` Justin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=479CCBAD.4060707@j-schmitz.net \
    --to=justin@j-schmitz.net \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox