Comments (8)
Yes, the parser is for current version only.
from cargo-bloat.
Looks like we have to write a custom v0 parser, since it's way more complex than legacy and we can't simply split the name by ::
.
This will also allow us to skip the disambiguation hashes.
But the format is quite complex and we can't use the rustc-demangle
parser, because it stateless/recursive.
from cargo-bloat.
It looks like https://github.com/michaelwoerister/std-mangle-rs is the recommended (rust-lang/rustc-demangle#28) solution to this problem.
from cargo-bloat.
Interesting. I will try it out. The only problem is how fast it would be when we need to parse thousands of names.
from cargo-bloat.
By the way, what is the difference between v0 and v2?
from cargo-bloat.
Also, look like the std-mangle-rs
crate is outdated:
> cargo run -- '_RNvMs1_NtCsgE5p2UZupUb_4json5valueNtB5_9JsonValue7is_null'
Finished dev [unoptimized + debuginfo] target(s) in 0.01s
Running `target/debug/rust-filt _RNvMs1_NtCsgE5p2UZupUb_4json5valueNtB5_9JsonValue7is_null`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "at position 40: Expected \'C\', \'M\', \'X\', \'Y\', \'N\', \'I\', or \'B\'; found \'1\' instead; while parsing <path>"', src/libcore/result.rs:999:5
from cargo-bloat.
Done. Please test it out.
from cargo-bloat.
Works great:
File .text Size Crate Name
0.0% 0.7% 61.2KiB gleam <gleam::ffi_gl::Gl>::load_with::<wrench::make_window::{closure#0}::{closure#0}>
0.0% 0.7% 61.1KiB gleam <gleam::ffi_gl::Gl>::load_with::<wrench::make_window::{closure#1}>
0.0% 0.6% 52.5KiB wrench <wrench::yaml_frame_writer::YamlFrameWriter>::write_display_list_items
0.0% 0.6% 47.6KiB regex_syntax <regex_syntax::ast::parse::ParserI<&mut regex_syntax::ast::parse::Parser>>::parse_with_comments
0.0% 0.5% 40.2KiB webrender <webrender::display_list_flattener::DisplayListFlattener>::flatten_item
0.0% 0.5% 37.5KiB wrench <wrench::rawtest::RawtestHarness>::run
0.0% 0.5% 37.3KiB wrench <wrench::yaml_frame_reader::YamlFrameReader>::add_display_list_items_from_yaml
0.0% 0.4% 35.1KiB wrench wrench::main
0.0% 0.4% 34.7KiB webrender <webrender::render_backend::RenderBackend>::process_api_msg
0.0% 0.4% 33.7KiB webrender <webrender::renderer::Renderer>::update
0.0% 0.4% 31.3KiB webrender <webrender::batch::BatchBuilder>::add_prim_to_batch
0.0% 0.4% 31.0KiB inflate <inflate::InflateStream>::next_state
0.0% 0.3% 27.0KiB webrender_api <webrender_api::display_item::DebugDisplayItem as serde::ser::Serialize>::serialize::<&mut serde_json::ser::Serializer<&mut alloc::vec::Vec<u8>, serde_json::ser::PrettyFormatter>>
0.0% 0.3% 25.6KiB winit <winit::platform::platform::x11::EventsLoop>::process_event::<&mut <winit::platform::platform::x11::EventsLoop>::run_forever<wrench::render::{closure#1}>::{closure#0}>
0.0% 0.3% 24.2KiB image <jpeg_decoder::decoder::Decoder<std::io::buffered::BufReader<std::fs::File>>>::decode_internal
0.0% 0.3% 24.0KiB clap <clap::app::parser::Parser>::get_matches_with::<&mut std::env::ArgsOs, std::ffi::os_str::OsString>
0.0% 0.3% 22.8KiB webrender <webrender::renderer::Renderer>::new::{closure#2}
0.0% 0.3% 22.8KiB gleam <gleam::ffi_gles::Gles2>::load_with::<wrench::make_window::{closure#0}::{closure#1}>
0.0% 0.3% 22.8KiB gleam <gleam::ffi_gles::Gles2>::load_with::<wrench::make_window::{closure#2}>
0.0% 0.3% 22.5KiB image <jpeg_decoder::decoder::Decoder<std::io::buffered::BufReader<std::fs::File>>>::decode_internal
3.4% 91.5% 7.3MiB And 14484 smaller methods. Use -n N to show more.
3.7% 100.0% 8.0MiB .text section size, the file size is 214.0MiB
from cargo-bloat.
Related Issues (20)
- Doesn't work with custom registries HOT 2
- Default test binary HOT 3
- --release flag fails HOT 4
- Add an option to sort output by crate/fn name instead of size HOT 1
- Discrepancy in reported `.text` size: `cargo bloat` vs GNU Binuils `size` HOT 3
- Cargo bloat doesn't forward compiler errors on build failure HOT 5
- don't suggest -n if all data is shown HOT 1
- Support custom profiles HOT 2
- How do I use cargo bloat with `-Zbuild-std`? HOT 7
- Incorrect target resolving
- Cargo bloaty reports only a tiny portion of the whole binary HOT 5
- How to examine other sections in the `.so` file? HOT 4
- Error: parsing failed cause 'section .symtab is missing'. HOT 10
- Detect `strip = true` in Cargo.toml HOT 3
- It "hangs" sometimes HOT 18
- Total time using cargo bloat --time? HOT 2
- missing releases on github HOT 2
- Info on the Size Calculation HOT 5
- FR: Cargo bloat should allow multiple `--features=foo` flags and merge them HOT 1
- [Q&A] Is there a tool or plugin that uses `cargo bloat` information to point at duplication due to monomorphization? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-bloat.