public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Bret Barkelew" <bret.barkelew@microsoft.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"daniel.schaefer@hpe.com" <daniel.schaefer@hpe.com>,
	Laszlo Ersek <lersek@redhat.com>
Cc: "Lin, Derek (HPS SW)" <derek.lin2@hpe.com>
Subject: Re: [edk2-devel] Multithreaded compression with LZMA2
Date: Thu, 3 Dec 2020 15:57:41 +0000	[thread overview]
Message-ID: <MW2PR2101MB0890493E7FB314D605B341BDEFF21@MW2PR2101MB0890.namprd21.prod.outlook.com> (raw)
In-Reply-To: <DF4PR8401MB04449394D5540D7E922BED40E0F20@DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM>


[-- Attachment #1.1: Type: text/plain, Size: 2653 bytes --]

Wasn’t there another push (somewhere in the last 8 months, my brain is foggy) to adopt LZMA2? Or was it a different algorithm?

- Bret

From: Daniel Schaefer via groups.io<mailto:daniel.schaefer=hpe.com@groups.io>
Sent: Thursday, December 3, 2020 4:12 AM
To: Laszlo Ersek<mailto:lersek@redhat.com>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Cc: Lin, Derek (HPS SW)<mailto:derek.lin2@hpe.com>
Subject: [EXTERNAL] Re: [edk2-devel] Multithreaded compression with LZMA2


From: Laszlo Ersek <lersek@redhat.com>
Sent: Thursday, December 3, 2020 18:24
To: devel@edk2.groups.io <devel@edk2.groups.io>; Schaefer, Daniel <daniel.schaefer@hpe.com>
Cc: Lin, Derek (HPS SW) <derek.lin2@hpe.com>
Subject: Re: [edk2-devel] Multithreaded compression with LZMA2

On 12/02/20 03:59, Daniel Schaefer wrote:
> Hi everyone,
>
> I'm looking into how to speed up the build process and noticed that our
> build
> uses LZMA to encrypt the main firmware volume. Since it's quite big it
> takes a
> while but only uses one CPU thread.
>
> LZMA2 is a version of LZMA which can be multi-threaded and achieve much
> faster
> compression times. I did a quick benchmark using the `xz` command-line
> tool,
> which uses a modified version of the LZMA SDK that EDK2 uses. The
> results are:
>
> Uncompressed size: 64M
>
> | Algo  | Comp Time | Decomp Time | Size | Threads |
> | ----- | --------- | ----------- | ---- | ------- |
> | LZMA  |    19.67s |        0.9s | 9.1M |       1 |
> | LZMA2 |    20.11s |        1.2s | 9.2M |       1 |
> | LZMA2 |     8.31s |        1.0s | 9.4M |       4 |
>
> Using those commands:
>
> time xz --format=lzma testfile
> time unlzma testfile.lzma
>
> time xz --lzma2 testfile
> time unxz testfile.xz
>
> time xz -T4 --lzma2 testfile
> time unxz testfile.xz
>
> This is quite a significant improvement of build time, while
> decompression time
> and size only slightly increase. If that's a concern, then LZMA2 could
> be used
> for development only.
>
> I haven't investigated the details of how to support this in the code
> but it
> appears to be a simple change, since the LZMA SDK that we use already
> supports
> LZMA2.
>
> What do you think?

"xz -T" works by splitting the input into blocks, and it generates a
multi-block compressed output.

Yes, that's correct.

> I'm unsure if the current LZMA
decompressor that runs inside the firmware (= guided section extractor)
copes with multi-block input.

I think you're right that it doesn't. But we can make the guided section extractor use that same algorithm(LZMA2) and assign it a different GUID, right?



[-- Attachment #1.2: Type: text/html, Size: 6002 bytes --]

[-- Attachment #2: 69F4FCEBBB92465AA3A93438CD55E1D3.png --]
[-- Type: image/png, Size: 140 bytes --]

  reply	other threads:[~2020-12-03 15:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02  2:59 Multithreaded compression with LZMA2 Daniel Schaefer
2020-12-02  3:36 ` [edk2-devel] " Andrew Fish
2020-12-02  5:21   ` 回复: " gaoliming
2020-12-02  8:24     ` Daniel Schaefer
2020-12-03 10:24 ` Laszlo Ersek
2020-12-03 12:11   ` Daniel Schaefer
2020-12-03 15:57     ` Bret Barkelew [this message]
2020-12-04  8:19       ` Daniel Schaefer
2020-12-03 23:35     ` Laszlo Ersek
2020-12-04  2:28       ` 回复: " gaoliming
2020-12-04  9:02         ` Daniel Schaefer
2020-12-08  6:01           ` 回复: " gaoliming

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-list 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=MW2PR2101MB0890493E7FB314D605B341BDEFF21@MW2PR2101MB0890.namprd21.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /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