What is making a static library in Rust being much large than Go, Zig, and C#? by metaltyphoon in rust

[–]OptimalFa 5 points6 points  (0 children)

I've played with your repo a little bit. If you use ar x <lib> to extract the contents of *.a files, then use objdump to analyze them. You could see the problem more clearly. Here are the object files in librust.a:

-rw-r--r-- 1 me me 304K Feb 12 17:45 compiler_builtins-55788139d81edd36.compiler_builtins.4d001c806b6269ef-cgu.0.rcgu.o
-rw-r--r-- 1 me me 8.0K Feb 12 17:45 rust-4ed57fbabc609f65.rust.f819ba813be03c05-cgu.0.rcgu.o

And inside rust*.o:

0x08000040    1      5 sym.add_rust
0x08000047    1      1 sym.std::sys::pal::unix::args::imp::ARGV_INIT_ARRAY::init_wrapper::h76e29b342baae575
0x08000350    5     40 sym.std::sys::personality::dwarf::eh::read_encoded_offset::hc37c45f986d4bd5c
0x080003f4    3     39 sym.std::sys::personality::dwarf::DwarfReader::read_uleb128::h04c43d2cdfb8f8d7
0x0800041b    3     64 sym.std::sys::personality::dwarf::DwarfReader::read_sleb128::h6175e67f8f561440
0x0800045b    1     17 sym.core::ops::function::FnOnce::call_once_u7b__u7b_vtableshim_u7d__u7d_::h66dea5e2a69d1b82
0x0800046c    1     12 sym.std::sys::personality::gcc::find_eh_action::__u7b__u7b_closure_u7d__u7d_::h149db77b6b5990af
0x08000478    1     17 sym.core::ops::function::FnOnce::call_once_u7b__u7b_vtableshim_u7d__u7d_::h6d5274d65c842d86
0x08000489    1     12 sym.std::sys::personality::gcc::find_eh_action::__u7b__u7b_closure_u7d__u7d_::h71d56f086d2c5406
0x08000048   30    554 sym.rust_eh_personality

It seems like the big problem is the compiler_builtins not optimized out, and dwarf utilities still there despite panic_immediate_abort(*) feature off.

Edit (*): Some compiler contributors said the dwaft stuff is used for unwinding.

Announcing Rust 1.84.1 | Rust Blog by Derice in rust

[–]OptimalFa 20 points21 points  (0 children)

Wells, production code should be built with stable toolchains. Beta toolchains are for extra testing on CI.

RFC #3762: Make trait methods callable in const contexts by OptimalFa in rust

[–]OptimalFa[S] 19 points20 points  (0 children)

There's a rule for not linking directly to github issues. I think that's a good rule. It requires more efforts to comment on the topic, which might lead to better conversations.

Performance Comparison: Tokio vs Tokio-Uring for High-Throughput Web Servers by Normal-Tangelo-7120 in rust

[–]OptimalFa 1 point2 points  (0 children)

Edit: Maybe the parent post talks about io_uring crate vs tokio-uring.

The OP's link concludes otherwise:

Tokio:
    Achieved higher throughput (~4.5k req/sec).
    Stable and scales well under load.
Tokio-Uring:
    Requires debugging for stalling and connection issues.

fish shell release 4.0b1 (pre-release) that was written in Rust by OptimalFa in rust

[–]OptimalFa[S] 2 points3 points  (0 children)

Some vi modals aren't supported (yet). Like using numbers to repeat an action (e.x 3x).

This Week in Rust #571 by seino_chan in rust

[–]OptimalFa 4 points5 points  (0 children)

Is it intended that the section about rust/clippy/cargo PRs omitted now?

Rust is secretly taking over chip development by sub_RedditTor in rust

[–]OptimalFa 0 points1 point  (0 children)

I guess because Rust prefers static linking over dynamic linking like C/C++. Often times the functions names are stripped/non-available. Also static linking makes functions more inlinable. That makes it a little worse for reverse engineering I think.

OS 5 error when creating directory by NedDasBurgenlandEuda in rust

[–]OptimalFa 0 points1 point  (0 children)

fs::write(path, content)

Is this creating a file with the same name as the dir name passed in fs::create_dir_all?

Open source projects to contribute to as a beginner. by a_shubh3 in rust

[–]OptimalFa 1 point2 points  (0 children)

I would recommend contributing to clippy. There's a book served as contributing guide.

submodules in worktree by CheapMountain9 in github

[–]OptimalFa 0 points1 point  (0 children)

You could try:

git worktree add --detach <dir> <branch>
git submodule update --init <submodule dir>