百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

bloaty-metafile

> 编程语言
开源

bloaty-metafile 是一个 CLI 工具,用于将 bloaty 生成的 csv 文件转换为 esbuild 的 metafile 格式,这样您就可以使用在线工具来进行代码分析了。

185 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

bloaty-metafile 是一个 CLI 工具,用于将 bloaty 生成的 csv 文件转换为 esbuild 的 metafile 格式,这样您就可以使用在线工具来进行代码分析了。

bloaty-metafile is a cli tool to convert csv files generated by bloaty to esbuild's metafile format, so that you can use online tools to analyze the size of the program

bash
cargo binstall bloaty-metafile

# or install from github
cargo install --git https://github.com/ahaoboy/bloaty-metafile

# https://github.com/google/bloaty/blob/main/doc/using.md
bloaty ./bloaty -d sections,symbols -n 0  --csv | bloaty-metafile > meta.json
bloaty-metafile meta.csv > meta.json

bloaty ./target/bloaty/bloaty-metafile -d sections,symbols -n 0  --csv | bloaty-metafile --name=bloaty-metafile --lock=Cargo.lock  > meta.json

profile

In order for bloaty to parse symbol information properly, it is recommended to keep debug information and turn off lto and strip

toml
[profile.bloaty]
debug = true
lto = false
strip = false
inherits = 'release'
bash
cargo build --profile bloaty

bloaty ./target/bloaty/bloaty-metafile -d sections,symbols -n 0 --csv > meta.csv

bloaty-metafile meta.csv > meta.json
bloaty-metafile meta.csv --sections > meta.json

csv format

Please make sure bloaty generates a csv file in the following format. If the program is too large and the generated json exceeds 100mb, use the -n parameter to reduce the amount of data.

sections,symbols,vmsize,filesize
.text,ossl_aes_gcm_encrypt_avx512,337642,337642
.text,ossl_aes_gcm_decrypt_avx512,337638,337638

Esbuild Bundle Size Analyzer

https://esbuild.github.io/analyze/

Generate image from json

You can use metafile-image implemented by nodejs to generate json files into image format, without manually uploading and screenshots

Usage

lock file

Because bloaty's output does not include crate dependency information, the sizes of crates are all displayed separately.

If a lock file can be provided, by default, the Cargo.lock file in the current directory is used. the dependency size can be correctly displayed by analyzing the crate dependencies.

deep

For large applications, the dependency tree will be very deep, which will cause the generated JSON to be very large and contain too much useless information. You can use the --deep option to limit the maximum depth of the dependency.

The default value of deep is 0(no limit)

deep: 4, json: 6.7M

deep: 8, json: 12M

deep: 0, json: 80M

sections

By default, section-level entries are excluded from the output as they occupy too much space and provide little useful information for crate-level analysis.

Use --sections to include them.

bash
bloaty-metafile meta.csv > meta.json              # sections excluded (default)
bloaty-metafile meta.csv --sections > meta.json   # sections included

Conversion rules

The symbol .text,easy_install::install::artifact will be converted to easy_install/.text/install/artifact.

Additionally, if symbol ends with .map, to prevent the esbuild analyzer from treating it as a JavaScript sourcemap file, the suffix will be converted to .map_.

If symbol is empty, it will be added to the UNKNOWN section.

windows

bloaty: PE doesn't support this data source

bloaty-metafile just converts the csv output by bloaty to json. You can generate csv files on other platforms with bloaty, and then convert them on windows.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言