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

Mike Kamermans <[email protected]> Wed, 15 Jul 2015 09:46:04 -0700
Newsgroups gmane.comp.web.fonts
Message-ID <CABhc0+J0sdrkD5UUdYbjwfQ3VtHacjQTF6LY7=OFg1-7VRQ-gA@mail.gmail.com>
--047d7bb04d2ccdc800051aecb0ac
Content-Type: text/plain; charset=UTF-8

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.

That said, a pure JS implementation would be great as "reality check" too,
so that for raw speed a (fixed) emscripten'd library is great, but for
sanity, a secondary implementation is available to hold emscripten
accountable to.

- Mike

On Tue, Jul 14, 2015 at 7:37 PM, Robert O'Callahan <[email protected]>
wrote:

> On Wed, Jul 15, 2015 at 11:25 AM, Mike Kamermans <[email protected]>
> wrote:
>
>> On the off-chance that anyone knows, fontkit (
>> https://github.com/devongovett/fontkit) is currently using an
>> emscripten'ed version of the Brotli codec for handling WOFF2 decoding,
>> which turns what is a 34MB footprint process without WOFF2 decoding into a
>> ~1000MB footprint process with... making it rather unusable for dealing
>> with WOFF2 files in any meaningful production setting.
>>
>
> That overhead sounds way too high. I guess something is wrong with
> emscripten or some other part of the workflow.
>
> 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
>

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

<div dir=3D"ltr"><div>Yeah,that&#39;s the conclusion we had to draw too - d=
ebugging the running process revealed that the emscripten&#39;d library was=
 allocating three massive array buffers (~313MB each), just by loading the =
library, so that&#39;s either a nasty emscripten bug, or could be a deferre=
d allocation pattern that works in C++ but turns into instant allocation in=
 JS.<br><br>That said, a pure JS implementation would be great as &quot;rea=
lity check&quot; too, so that for raw speed a (fixed) emscripten&#39;d libr=
ary is great, but for sanity, a secondary implementation is available to ho=
ld emscripten accountable to.<br><br></div>- Mike<br></div><div class=3D"gm=
ail_extra"><br><div class=3D"gmail_quote">On Tue, Jul 14, 2015 at 7:37 PM, =
Robert O&#39;Callahan <span dir=3D"ltr">&lt;<a href=3D"mailto:robert@ocalla=
han.org" target=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex"><div dir=3D"ltr"><span class=3D"">On Wed, Jul =
15, 2015 at 11:25 AM, Mike Kamermans <span dir=3D"ltr">&lt;<a href=3D"mailt=
o:[email protected]" target=3D"_blank">[email protected]</a>&gt;</span> wro=
te:<br></span><div class=3D"gmail_extra"><div class=3D"gmail_quote"><span c=
lass=3D""><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div>On the =
off-chance that anyone knows, fontkit (<a href=3D"https://github.com/devong=
ovett/fontkit" target=3D"_blank">https://github.com/devongovett/fontkit</a>=
) is currently using an emscripten&#39;ed version of the Brotli codec for h=
andling WOFF2 decoding, which turns what is a 34MB footprint process withou=
t WOFF2 decoding into a ~1000MB footprint process with... making it rather =
unusable for dealing with WOFF2 files in any meaningful production setting.=
<br></div></div></div></blockquote><div><br></div></span><div>That overhead=
 sounds way too high. I guess something is wrong with emscripten or some ot=
her part of the workflow.<br></div></div><br clear=3D"all"></div><div class=
=3D"gmail_extra">Rob<span class=3D"HOEnZb"><font color=3D"#888888"><br></fo=
nt></span></div><span class=3D"HOEnZb"><font color=3D"#888888"><div class=
=3D"gmail_extra">-- <br><div><div dir=3D"ltr">lbir ye,ea yer.tnietoehr=C2=
=A0 rdn rdsme,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 kbvt=
ed,t rdsme,aoreseoouoto<br>o l euetiuruewFa=C2=A0 kbn e hnystoivateweh ures=
yf tulsa rehr=C2=A0 rdm=C2=A0 or rnea lurpr =C2=A0<br>.a war hsrer holsa ro=
dvted,t=C2=A0 nenh hneireseoouot.tniesiewaoeivatewt sstvr=C2=A0 esn<br></di=
v></div>
</div></font></span></div>
</blockquote></div><br></div>

--047d7bb04d2ccdc800051aecb0ac--