<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 0x5457</title>
    <description>The latest articles on DEV Community by 0x5457 (@0x5457).</description>
    <link>https://dev.to/0x5457</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F617102%2F0be8faad-386b-4bca-9c51-5e649dbfe533.png</url>
      <title>DEV Community: 0x5457</title>
      <link>https://dev.to/0x5457</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/0x5457"/>
    <language>en</language>
    <item>
      <title>What’s inside a 143 MiB Hello World?</title>
      <dc:creator>0x5457</dc:creator>
      <pubDate>Fri, 27 Nov 2026 15:35:21 +0000</pubDate>
      <link>https://dev.to/0x5457/whats-inside-a-143-mib-hello-world-10jo</link>
      <guid>https://dev.to/0x5457/whats-inside-a-143-mib-hello-world-10jo</guid>
      <description>&lt;p&gt;I fed &lt;code&gt;console.log('hello')&lt;/code&gt; to Node’s single executable builder. The result was &lt;strong&gt;143.46 MiB&lt;/strong&gt;. Then I measured the &lt;code&gt;node&lt;/code&gt; binary I started with: &lt;strong&gt;143.46 MiB&lt;/strong&gt;, too. The difference, before rounding, was &lt;strong&gt;7,260 bytes&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That’s the useful number. There’s not much left to save by minifying &lt;code&gt;hello&lt;/code&gt;. Almost all of the file is what you need to run it in a full copy of Node. I built &lt;a href="https://github.com/thinpack-js/thinpack.js" rel="noopener noreferrer"&gt;Thinpack.js&lt;/a&gt; to see what happens if you build the runtime around the app instead. Thinpack v0.3.0’s &lt;a href="https://github.com/thinpack-js/thinpack.js/actions/runs/45758437086" rel="noopener noreferrer"&gt;Linux x64 CI build&lt;/a&gt; ships the same one-line program in &lt;strong&gt;4.03 MiB&lt;/strong&gt;, including its runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Node SEA actually ships
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://nodejs.org/api/single-executable-applications.html" rel="noopener noreferrer"&gt;Node SEA&lt;/a&gt; embeds the application in a &lt;code&gt;node&lt;/code&gt; executable. You get the real Node runtime, which is a good reason to use it. You also get the build you started with, even when your app doesn’t use most of it.&lt;/p&gt;

&lt;p&gt;Here’s my measurement with Node &lt;strong&gt;26.8.1&lt;/strong&gt;, Linux x64, no assets or application snapshot:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;Bytes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;node&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;150,425,704&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;hello-sea&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;150,432,964&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Added by packaging&lt;/td&gt;
&lt;td&gt;7,260&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"console.log('hello');"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; hello.cjs
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'{"main":"hello.cjs","output":"hello-sea"}'&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; sea.json
node --build-sea sea.json
./hello-sea
wc -c &lt;span class="s2"&gt;"$(command -v node)"&lt;/span&gt; hello-sea
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I wanted to know how much of those 143 MiB was V8. So I looked at the ELF and its symbol table, rather than calling the entire file the engine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;V8: at least 21.33 MiB of identifiable symbols.&lt;/strong&gt; I summed non-overlapping, file-backed ranges for symbols named &lt;code&gt;v8::…&lt;/code&gt;, &lt;code&gt;Builtins_…&lt;/code&gt;, and the named V8 embedded blobs. That misses generated or unnamed data and other engine code. It’s a partial count in this particular binary, not the size of a standalone V8 build.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Node’s built-in JavaScript: 9.92 MiB of source.&lt;/strong&gt; That’s 415 strings exposed by &lt;code&gt;process.binding('natives')&lt;/code&gt; in this build. It includes internals, not just public modules, and it doesn’t count the native code behind those modules. It measures decoded source, not bytes attributed to the ELF on disk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ICU data: 31.57 MiB in this build.&lt;/strong&gt; That’s one data symbol, &lt;code&gt;icudt78_dat&lt;/code&gt;. The &lt;code&gt;.debug_*&lt;/code&gt;, &lt;code&gt;.symtab&lt;/code&gt;, and &lt;code&gt;.strtab&lt;/code&gt; sections account for another 31.63 MiB in this unstripped file. Different Node builds can carry different data and metadata.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those numbers don’t add up to a full accounting, and the JavaScript source count isn’t an on-disk component. But they answer the first question: there’s much more in a Node executable than V8 and the public standard library.&lt;/p&gt;

&lt;h2&gt;
  
  
  What can a packer leave out?
&lt;/h2&gt;

&lt;p&gt;QuickJS takes care of running JavaScript. It doesn’t know what &lt;code&gt;node:fs&lt;/code&gt; means. Thinpack still needs a module loader, a way to call the host, and implementations for the Node APIs the app uses. Where practical, it reuses Node’s JavaScript code and connects it to its own host operations.&lt;/p&gt;

&lt;p&gt;In one local Linux x64 small-profile build, the &lt;strong&gt;QuickJS-NG static archive&lt;/strong&gt; was &lt;strong&gt;1.45 MiB&lt;/strong&gt; on disk; GNU &lt;code&gt;size&lt;/code&gt; reported about &lt;strong&gt;625 KiB&lt;/strong&gt; of text plus initialized data across its objects. The first number includes archive and object metadata. The second still isn’t the exact number of bytes the linker keeps. Neither includes the rest of Thinpack.&lt;/p&gt;

&lt;p&gt;To measure the two knobs separately, here’s the project’s &lt;a href="https://github.com/thinpack-js/thinpack.js/blob/v0.3.0/docs/benchmarks.md#runtime-template-size" rel="noopener noreferrer"&gt;same-profile runtime template comparison&lt;/a&gt;. These are template measurements, separate from the Hello CI result:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Backend&lt;/th&gt;
&lt;th&gt;Core template&lt;/th&gt;
&lt;th&gt;All built-ins&lt;/th&gt;
&lt;th&gt;Cost of enabling the full set&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;QuickJS&lt;/td&gt;
&lt;td&gt;5.20 MiB&lt;/td&gt;
&lt;td&gt;11.61 MiB&lt;/td&gt;
&lt;td&gt;+6.41 MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;V8&lt;/td&gt;
&lt;td&gt;45.82 MiB&lt;/td&gt;
&lt;td&gt;52.25 MiB&lt;/td&gt;
&lt;td&gt;+6.43 MiB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Switching backends changes the core template by &lt;strong&gt;40.62 MiB&lt;/strong&gt; in that setup. That includes the different engine integration, so it isn’t a standalone V8 measurement. On either backend, enabling all the supported built-ins costs another &lt;strong&gt;roughly 6.4 MiB&lt;/strong&gt;, including their support code. The two savings come from different decisions.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the executable gets assembled
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  app entry
      |
  Oxc + module resolution
      |
      +--&amp;gt; app files and assets ------&amp;gt; payload
      |                                    |
      +--&amp;gt; needed Node built-ins           |
           + their dependencies           |
           + always-on APIs                |
                    |                      |
                --rebuild                  |
                    v                      v
              +--------------+---------+---------+
  executable: | runtime      | payload | trailer |
              +--------------+---------+---------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add &lt;code&gt;require('node:crypto')&lt;/code&gt; to Hello, and &lt;code&gt;--list-capabilities&lt;/code&gt; shows four new entries: &lt;code&gt;crypto&lt;/code&gt;, &lt;code&gt;stream&lt;/code&gt;, &lt;code&gt;events&lt;/code&gt;, and &lt;code&gt;string_decoder&lt;/code&gt;. The app names only the first one. The others follow from the &lt;a href="https://github.com/thinpack-js/thinpack.js/blob/v0.3.0/capabilities.toml" rel="noopener noreferrer"&gt;runtime’s dependency graph&lt;/a&gt;. With &lt;a href="https://github.com/thinpack-js/thinpack.js/blob/v0.3.0/docs/reference.md#downloads-and-runtime-choices" rel="noopener noreferrer"&gt;&lt;code&gt;--rebuild&lt;/code&gt;&lt;/a&gt;, Thinpack compiles a runtime for that set, then appends the app’s files. The standard library is trimmed &lt;strong&gt;at build time&lt;/strong&gt;. The prebuilt template skips the rebuild and ships all the built-ins.&lt;/p&gt;

&lt;p&gt;Does this matter beyond Hello? The &lt;a href="https://github.com/thinpack-js/thinpack.js/blob/v0.3.0/tests/apps/baseline.toml" rel="noopener noreferrer"&gt;v0.3.0 app size baseline&lt;/a&gt; records &lt;strong&gt;4.55 MiB&lt;/strong&gt; for &lt;code&gt;js-yaml&lt;/code&gt; and &lt;strong&gt;6.53 MiB&lt;/strong&gt; for &lt;code&gt;tsc&lt;/code&gt; on Linux x64. Size isn’t speed, though. In a &lt;a href="https://github.com/thinpack-js/thinpack.js/blob/v0.3.0/docs/benchmarks.md#other-clis" rel="noopener noreferrer"&gt;separate earlier benchmark&lt;/a&gt;, &lt;code&gt;tsc --version&lt;/code&gt; took 347 ms warm with Thinpack and 77 ms with that Node SEA build. That measures startup, not a TypeScript compile.&lt;/p&gt;

&lt;p&gt;I’d use SEA when I need the actual Node runtime. I’d try Thinpack when the size of the binary matters and I can test the commands I ship. Dynamic imports and assets can need explicit includes, and Thinpack doesn’t implement every Node API. If you maintain a CLI and try &lt;a href="https://github.com/thinpack-js/thinpack.js#quick-start" rel="noopener noreferrer"&gt;the quick start&lt;/a&gt;, I’d like to hear what you packed, how large it was, and what ran outside your source tree.&lt;/p&gt;

</description>
      <category>node</category>
      <category>typescript</category>
      <category>rust</category>
    </item>
  </channel>
</rss>
