public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gmail.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: "Jeff Law" <law@redhat.com>, "Martin Liška" <mliska@suse.cz>,
	"GCC Development" <gcc@gcc.gnu.org>,
	"Jan Hubicka" <hubicka@ucw.cz>
Subject: Re: [RFC] zstd as a compression algorithm for LTO
Date: Wed, 19 Jun 2019 19:26:00 -0000	[thread overview]
Message-ID: <CA+=Sn1kaGR00rtVXDtDufk-68reSZC-K-y_a5O7UMoSH+YD1oQ@mail.gmail.com> (raw)
In-Reply-To: <1BBDAEDD-9432-4B12-BA20-63A6E047FDB6@gmail.com>

On Wed, Jun 19, 2019 at 11:55 AM Richard Biener
<richard.guenther@gmail.com> wrote:
>
> On June 19, 2019 6:03:21 PM GMT+02:00, Jeff Law <law@redhat.com> wrote:
> >On 6/19/19 3:21 AM, Martin Liška wrote:
> >> Hi.
> >>
> >> I've written a patch draft that replaces zlib with the zstd
> >compression algorithm ([1])
> >> in LTO. I'm also sending statistics that are collected for couple of
> >quite big C++ source
> >> files. Observation I did:
> >>
> >> - LTO stream compression takes 3-4% of LGEN compile time
> >> - zstd in default compression level (3) generated slighly smaller LTO
> >elf files
> >> - zstd compression is 4-8x faster
> >> - decompression is quite negligible, but for a bigger project (godot)
> >I can
> >>   reduction from 1.37 to 0.53 seconds
> >> - ZSTD API is much simpler to use
> >>
> >> Suggestion based on the observation:
> >> - I would suggest to make zstd optional (--enable-zstd) and one would
> >>   use #include <zstd> + -lzstd
> >> - I like the default level as we want to mainly speed up LTO
> >compilation
> >> - we can provide an option to control algorithm
> >(-flto-compression-algorithm),
> >>   similarly to -flto-compression-level
> >> - we can discuss possible compression of LTO bytecode that is
> >distributed between WPA
> >>   stage and individual LTRANS phases.
> >Presumably the reason we're not being more aggressive about switching
> >is
> >the build/run time dependency on zstd?  I wonder if we could default to
> >zstd and fallback to zlib when zstd isn't available?
>
> Is zstd too big to include into the repository? But yes, we can properly encode the compression format in the LTO section header and use dlopen to 'find' the default to use.

At least allow it to be built as part of the normal build like GMP,
etc. are done.
And include it in downloading using contrib/download_prerequisites
like the libraries are done.

Thanks,
Andrew Pinski

>
> Richard.
>
> >jeff
>

  reply	other threads:[~2019-06-19 19:26 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-19  9:21 Martin Liška
2019-06-19 16:03 ` Jeff Law
2019-06-19 18:55   ` Richard Biener
2019-06-19 19:26     ` Andrew Pinski [this message]
2019-06-19 19:29       ` Jan Hubicka
2019-06-19 19:34         ` Andrew Pinski
2019-06-20  9:08           ` Martin Liška
2019-06-20 10:59             ` Thomas Koenig
2019-06-20 11:42               ` Martin Liška
2019-06-20 12:02                 ` Jan Hubicka
2019-06-21 10:20                   ` [PATCH] Add .gnu.lto_.meta section Martin Liška
2019-06-21 12:34                     ` Richard Biener
2019-06-21 12:49                       ` Martin Liška
2019-06-21 12:57                         ` Jan Hubicka
2019-06-21 14:01                           ` Martin Liška
2019-06-24 12:02                             ` Richard Biener
2019-06-24 12:12                               ` Martin Liška
2019-06-24 12:44                                 ` Richard Biener
2019-06-24 13:31                                   ` Martin Liška
2019-06-24 14:25                                     ` Iain Sandoe
2019-06-24 18:05                                     ` Richard Biener
2019-06-25  8:14                                       ` Martin Liška
2019-06-25 14:15                                         ` Richard Biener
2019-06-27 12:28                                           ` [PATCH] Add .gnu.lto_.lto section Martin Liška
2019-07-01 10:59                                             ` Martin Liška
2019-07-01 11:01                                               ` [PATCH 2/2] Add zstd support for LTO bytecode compression Martin Liška
2019-07-02 20:50                                                 ` Jeff Law
2019-07-02 20:49                                               ` [PATCH] Add .gnu.lto_.lto section Jeff Law
2019-06-20 12:12                 ` [RFC] zstd as a compression algorithm for LTO Thomas Koenig
2019-06-20 17:02             ` Joseph Myers
2019-06-20 10:46         ` Segher Boessenkool
2019-06-20 11:44           ` Martin Liška

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='CA+=Sn1kaGR00rtVXDtDufk-68reSZC-K-y_a5O7UMoSH+YD1oQ@mail.gmail.com' \
    --to=pinskia@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=law@redhat.com \
    --cc=mliska@suse.cz \
    --cc=richard.guenther@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).