Browse docs

Analyzing Binary Bloat

lde bloat builds your project and shows what makes up the compiled binary, aka which dependencies and files take how much space, as a percentage of the total. It’s the quickest way to find what you can cut down on to reduce your bundle size.

How it works

lde builds your project and installs dependencies into ./target/, then measures exactly what lde compile would embed: each Lua module compiled to LuaJIT bytecode, plus every native shared library (.so / .dll / .dylib). No C toolchain is required. Content is grouped by dependency and sorted by size, so the biggest bloat is always at the top.

Basic usage

lde bloat

The report shows:

Interactive mode

In a terminal, lde bloat is interactive: dependencies start collapsed ([ ]), and you can:

When stdout is piped or redirected, the full static tree is printed instead.

Comparing against a compiled binary

By default, percentages are of the embedded bundle. Pass --binary to also compare against a compiled executable and see the LuaJIT runtime’s fixed overhead:

lde compile
lde bloat --binary            # uses ./<name> from lde compile
lde bloat --binary dist/app   # or a specific path

The report then shows the binary’s total size and how much of it is the LuaJIT runtime + C glue.

JSON report

--json prints the report as JSON to stdout (a path writes it to a file):

lde bloat --json              # stdout
lde bloat --json report.json