From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=BAYES_20,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a37:693:: with SMTP id 141mr7000946qkg.453.1623478531273; Fri, 11 Jun 2021 23:15:31 -0700 (PDT) X-Received: by 2002:a25:4009:: with SMTP id n9mr10532115yba.73.1623478530966; Fri, 11 Jun 2021 23:15:30 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 11 Jun 2021 23:15:30 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=5.51.16.193; posting-account=lzjH_AoAAABq5H4FTxZ1AkonVQLbXoxB NNTP-Posting-Host: 5.51.16.193 References: <34845325-0cb5-43ee-a03f-df95a8df1f22n@googlegroups.com> <1ded0c7a-f8b6-43e2-8402-5666561615b0n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4d308948-f3ba-483f-b46d-55bcb9d3299en@googlegroups.com> Subject: Re: ANN: Ada Resource Embedder for C, Ada and Go From: Stephane Carrez Injection-Date: Sat, 12 Jun 2021 06:15:31 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:62187 List-Id: Le vendredi 11 juin 2021 =C3=A0 21:53:09 UTC+2, Dmitry A. Kazakov a =C3=A9c= rit=C2=A0: > On 2021-06-11 20:44, Stephane Carrez wrote:=20 > > Thanks Dimitry for the clarification.=20 > >=20 > > Different requirements leads to different solutions.=20 > >=20 > > With ARE, I want to embed a Javascript file (such as jQuery), minify it= with closure, compress it with gzip=20 > > and make it available as raw content so that the web server can service= it without reading any file.=20 > > The content being accessible through either an Ada generated variable o= r through a function,=20 > > it is mapped in memory (we avoid an open, read, close system call plus = the gzip stuff) and=20 > > the server only has to return the buffer content. > Same here. In the case of an integrated HTTP server I simply store the=20 > HTTP pages as a set of string constants and functions generating dynamic= =20 > portions of. The HTTP server uses no external files. Most pages never=20 > exist in any moment of time, because the server generates portions of=20 > them and sends away chunks as soon as possible. For this reason I do not= =20 > compress any pages. It would waste too much resources on a small=20 > embedded system and does not really matter for a large PC. Not the same. ARE takes a static content and converts it in an Ada source t= hat you compile. Compression can help even on embedded systems because it reduces the size o= f data transfer. A jquery-3.4.1.js file is arround 273K. Minified by closure it is reduced t= o 89K. If you also compress it, it reduces to 31K. On slow networks these size reduction make a difference. There is no waste of resource because the compression is made during the bu= ild process not at runtime. I would say the opposite: what you get is smaller in size. Best regards, Stephane