Re: Is there a pure JS implementation of the WOFF2 Brotli codec?

"Robert O'Callahan" <[email protected]> Thu, 16 Jul 2015 14:39:49 +1200
Newsgroups gmane.comp.web.fonts
Message-ID <CAOp6jLb4VtG3ie0MU40ZtwkMv+hMZYsAG-aGPzp=qvndOTSL=g@mail.gmail.com>
--047d7b2e12b338d2c9051af4fc64
Content-Type: text/plain; charset=UTF-8

On Thu, Jul 16, 2015 at 5:07 AM, Jonathan Kew <[email protected]> wrote:

> On 15/7/15 17:46, Mike Kamermans wrote:
>
>> Yeah,that's the conclusion we had to draw too - debugging the running
>> process revealed that the emscripten'd library was allocating three
>> massive array buffers (~313MB each), just by loading the library, so
>> that's either a nasty emscripten bug, or could be a deferred allocation
>> pattern that works in C++ but turns into instant allocation in JS.
>>
>
> Note that Brotli makes use of a very large static array, of which there
> are separate copies in the encoder and decoder sources; see
>
>   https://github.com/google/brotli/blob/master/dec/dictionary.h
>   https://github.com/google/brotli/blob/master/enc/dictionary.h


Those arrays are < 128K each, which would only account for a negligible
amount of the sizes Mike observed.

Rob
-- 
lbir ye,ea yer.tnietoehr  rdn rdsme,anea lurpr  edna e hnysnenh hhe uresyf
toD
selthor  stor  edna  siewaoeodm  or v sstvr  esBa  kbvted,t
rdsme,aoreseoouoto
o l euetiuruewFa  kbn e hnystoivateweh uresyf tulsa rehr  rdm  or rnea
lurpr
.a war hsrer holsa rodvted,t  nenh hneireseoouot.tniesiewaoeivatewt sstvr
esn

--047d7b2e12b338d2c9051af4fc64
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Thu, Jul 16, 2015 at 5:07 AM, Jonathan Kew <span dir=3D=
"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">jfkthame@=
gmail.com</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D=
"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;=
border-left:1px #ccc solid;padding-left:1ex"><span class=3D"">On 15/7/15 17=
:46, Mike Kamermans wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
Yeah,that&#39;s the conclusion we had to draw too - debugging the running<b=
r>
process revealed that the emscripten&#39;d library was allocating three<br>
massive array buffers (~313MB each), just by loading the library, so<br>
that&#39;s either a nasty emscripten bug, or could be a deferred allocation=
<br>
pattern that works in C++ but turns into instant allocation in JS.<br>
</blockquote>
<br></span>
Note that Brotli makes use of a very large static array, of which there are=
 separate copies in the encoder and decoder sources; see<br>
<br>
=C2=A0 <a href=3D"https://github.com/google/brotli/blob/master/dec/dictiona=
ry.h" rel=3D"noreferrer" target=3D"_blank">https://github.com/google/brotli=
/blob/master/dec/dictionary.h</a><br>
=C2=A0 <a href=3D"https://github.com/google/brotli/blob/master/enc/dictiona=
ry.h" rel=3D"noreferrer" target=3D"_blank">https://github.com/google/brotli=
/blob/master/enc/dictionary.h</a></blockquote><div><br></div><div>Those arr=
ays are &lt; 128K each, which would only account for a negligible amount of=
 the sizes Mike observed.<br></div></div><br clear=3D"all"></div><div class=
=3D"gmail_extra">Rob<br></div><div class=3D"gmail_extra">-- <br><div class=
=3D"gmail_signature"><div dir=3D"ltr">lbir ye,ea yer.tnietoehr=C2=A0 rdn rd=
sme,anea lurpr=C2=A0 edna e hnysnenh hhe uresyf toD<br>selthor=C2=A0 stor=
=C2=A0 edna=C2=A0 siewaoeodm=C2=A0 or v sstvr=C2=A0 esBa=C2=A0 kbvted,t rds=
me,aoreseoouoto<br>o l euetiuruewFa=C2=A0 kbn e hnystoivateweh uresyf tulsa=
 rehr=C2=A0 rdm=C2=A0 or rnea lurpr =C2=A0<br>.a war hsrer holsa rodvted,t=
=C2=A0 nenh hneireseoouot.tniesiewaoeivatewt sstvr=C2=A0 esn<br></div></div=
>
</div></div>

--047d7b2e12b338d2c9051af4fc64--