Skip to content

linter: investigate large binary size #9998

@Boshen

Description

@Boshen

With our increasing number of functionalities and rules, our binary size has increased to 13.4 MB.

cargo bloat --release -p oxlint:

File  .text    Size          Crate Name
 0.9%   1.3% 59.9KiB regex_automata regex_automata::meta::strategy::new
 0.7%   1.1% 51.5KiB            std std::sys::pal::common::small_c_string::run_with_cstr_allocating
 0.6%   0.9% 41.0KiB         oxlint <oxlint::lint::LintRunner as oxlint::runner::Runner>::run
 0.4%   0.6% 26.5KiB     oxc_linter oxc_linter::service::runtime::Runtime::process_source
 0.3%   0.5% 22.2KiB    oxc_codegen <oxc_ast::ast::js::Statement as oxc_codegen::gen::Gen>::gen
 0.3%   0.5% 21.2KiB         oxlint oxlint::command::lint::lint_command
 0.3%   0.5% 20.7KiB   oxc_semantic oxc_semantic::checker::check
 0.3%   0.4% 19.1KiB            std core::ops::function::FnOnce::call_once
 0.3%   0.4% 18.3KiB         oxlint oxlint::main
 0.3%   0.4% 18.0KiB     oxc_linter oxc_linter::Linter::run
 0.2%   0.3% 14.7KiB         ignore std::sys::backtrace::__rust_begin_short_backtrace
 0.2%   0.3% 14.2KiB regex_automata regex_automata::nfa::thompson::compiler::Compiler::c
 0.2%   0.3% 13.5KiB     oxc_linter core::slice::sort::stable::quicksort::quicksort
 0.2%   0.3% 13.3KiB         oxlint oxlint::command::lint::lint_command::{{closure}}
 0.2%   0.3% 13.1KiB      [Unknown] __mh_execute_header
 0.2%   0.3% 12.8KiB         miette miette::handlers::graphical::GraphicalReportHandler::render_context
 0.2%   0.3% 12.6KiB         miette miette::handlers::graphical::GraphicalReportHandler::render_context
 0.2%   0.3% 12.2KiB        globset globset::GlobSet::new
 0.2%   0.3% 11.5KiB     oxc_linter <oxc_linter::rules::jsx_a11y::role_supports_aria_props::RoleSupportsAriaProps as oxc_linter::rule...
 0.2%   0.2% 11.0KiB     oxc_linter <oxc_linter::rules::jsx_a11y::alt_text::AltText as oxc_linter::rule::Rule>::run
60.1%  92.1%  4.1MiB                And 6127 smaller methods. Use -n N to show more.
65.3% 100.0%  4.5MiB                .text section size, the file size is 6.8MiB

I'm not sure whether all the documentation texts are included, they shouldn't be included.

Metadata

Metadata

Labels

E-Help WantedExperience level - For the experienced collaborators

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions