<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:DengXian;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ZH-CN link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica",sans-serif'>Daniel:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:DengXian'>  Can you provide the compressed image size? And, what image is used to be compressed? Is it the generated FV image?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:DengXian'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:DengXian'>Thanks<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:10.5pt;font-family:DengXian'>Liming<o:p></o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-family:DengXian'>发件人<span lang=EN-US>:</span></span></b><span lang=EN-US style='font-family:DengXian'> bounce+27952+68159+4905953+8761045@groups.io <bounce+27952+68159+4905953+8761045@groups.io> </span><b><span style='font-family:DengXian'>代表 </span></b><span lang=EN-US style='font-family:DengXian'>Andrew Fish via groups.io<br></span><b><span style='font-family:DengXian'>发送时间<span lang=EN-US>:</span></span></b><span lang=EN-US style='font-family:DengXian'> 2020</span><span style='font-family:DengXian'>年<span lang=EN-US>12</span>月<span lang=EN-US>2</span>日<span lang=EN-US> 11:37<br></span><b>收件人<span lang=EN-US>:</span></b><span lang=EN-US> devel@edk2.groups.io; daniel.schaefer@hpe.com<br></span><b>抄送<span lang=EN-US>:</span></b><span lang=EN-US> derek.lin2@hpe.com<br></span><b>主题<span lang=EN-US>:</span></b><span lang=EN-US> Re: [edk2-devel] Multithreaded compression with LZMA2<o:p></o:p></span></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><p class=MsoNormal><span lang=EN-US><br><br><o:p></o:p></span></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span lang=EN-US>On Dec 1, 2020, at 6:59 PM, Daniel Schaefer <<a href="mailto:daniel.schaefer@hpe.com">daniel.schaefer@hpe.com</a>> wrote:<o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica",sans-serif'>Hi everyone,<br><br>I'm looking into how to speed up the build process and noticed that our build<br>uses LZMA to encrypt the main firmware volume. Since it's quite big it takes a<br>while but only uses one CPU thread.<br><br>LZMA2 is a version of LZMA which can be multi-threaded and achieve much faster<br>compression times. I did a quick benchmark using the `xz` command-line tool,<br>which uses a modified version of the LZMA SDK that EDK2 uses. The results are:<br><br>Uncompressed size: 64M<br><br>| Algo  | Comp Time | Decomp Time | Size | Threads |<br>| ----- | --------- | ----------- | ---- | ------- |<br>| LZMA  |    19.67s |        0.9s | 9.1M |       1 |<br>| LZMA2 |    20.11s |        1.2s | 9.2M |       1 |<br>| LZMA2 |     8.31s |        1.0s | 9.4M |       4 |<br><br>Using those commands:<br><br>time xz --format=lzma testfile<br>time unlzma testfile.lzma<br><br>time xz --lzma2 testfile<br>time unxz testfile.xz<br><br>time xz -T4 --lzma2 testfile<br>time unxz testfile.xz<br><br>This is quite a significant improvement of build time, while decompression time<br>and size only slightly increase. If that's a concern, then LZMA2 could be used<br>for development only.<br><br>I haven't investigated the details of how to support this in the code but it<br>appears to be a simple change, since the LZMA SDK that we use already supports<br>LZMA2.<br><br>What do you think?<br style='caret-color: rgb(0, 0, 0);font-variant-caps: normal;text-align:start;-webkit-text-stroke-width: 0px;word-spacing:0px'><br></span><span lang=EN-US><o:p></o:p></span></p></div></blockquote><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Interesting idea. What OS did you use? I tried this on macOS on some larger FVs and I did not see much difference? I tried a 17.5 MiB FV and it was around 3 seconds both ways. <o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Maybe it would be worth while seeing how it works on various systems? I guess it might be data set related? <o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Thanks,<o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US>Andrew Fish<o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US><br><br><o:p></o:p></span></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica",sans-serif'>Thanks,<br>Daniel<br><br><br style='caret-color: rgb(0, 0, 0);font-variant-caps: normal;text-align:start;-webkit-text-stroke-width: 0px;word-spacing:0px'><br></span><span lang=EN-US><o:p></o:p></span></p></div></blockquote></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><p class=MsoNormal></o:p></span></p></div></div></body></html>


 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr> Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/68160">View/Reply Online (#68160)</a> |    |  <a target="_blank" href="https://groups.io/mt/78653662/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>