Giter VIP home page Giter VIP logo

Comments (8)

RazrFalcon avatar RazrFalcon commented on June 24, 2024

Yes, the parser is for current version only.

from cargo-bloat.

RazrFalcon avatar RazrFalcon commented on June 24, 2024

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.

jrmuizel avatar jrmuizel commented on June 24, 2024

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.

RazrFalcon avatar RazrFalcon commented on June 24, 2024

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.

RazrFalcon avatar RazrFalcon commented on June 24, 2024

By the way, what is the difference between v0 and v2?

from cargo-bloat.

RazrFalcon avatar RazrFalcon commented on June 24, 2024

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.

RazrFalcon avatar RazrFalcon commented on June 24, 2024

Done. Please test it out.

from cargo-bloat.

jrmuizel avatar jrmuizel commented on June 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.