Move NativeLib::filename to the rmeta-link archive member#156735
Move NativeLib::filename to the rmeta-link archive member#156735mehdiakiki wants to merge 1 commit into
Conversation
|
rustbot has assigned @dingxiangfei2009. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
053432f to
8f96681
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
8f96681 to
5a93c75
Compare
|
r? @petrochenkov |
5a93c75 to
3b0d8b8
Compare
|
Started working on it today. Should have it ready soon. |
3b0d8b8 to
e923f64
Compare
This comment has been minimized.
This comment has been minimized.
e923f64 to
2414bd9
Compare
This comment has been minimized.
This comment has been minimized.
2414bd9 to
b0da354
Compare
This comment has been minimized.
This comment has been minimized.
b0da354 to
92610ca
Compare
This comment has been minimized.
This comment has been minimized.
92610ca to
70f18ca
Compare
This comment has been minimized.
This comment has been minimized.
70f18ca to
578ba56
Compare
This comment has been minimized.
This comment has been minimized.
eb99ef8 to
7dba437
Compare
This comment has been minimized.
This comment has been minimized.
7dba437 to
ac119d2
Compare
|
@rustbot ready |
| tcx.native_libraries(cnum).iter().map(Into::into).collect(); | ||
| let used_crate_source = tcx.used_crate_source(cnum); | ||
| info.native_libraries.insert(cnum, native_libs); | ||
| info.crate_name.insert(cnum, tcx.crate_name(cnum)); |
There was a problem hiding this comment.
The changes remaining in this file look unnecessary.
|
I don't like that |
| read(&archive, archive_data, rlib_path) | ||
| } | ||
|
|
||
| pub fn read_from_path(target: &Target, path: &Path) -> Option<RmetaLink> { |
There was a problem hiding this comment.
Could you add a FIXME comment saying that this is mostly a copypaste of DefaultMetadataLoader::get_rlib_metadata?
|
We are doing a lot of redundant work here, by calling both Although if it doesn't show perf regressions on regular code not using bundled native libs, then it's probably tolerable, and the rewrite can happen later. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Move NativeLib::filename to the rmeta-link archive member
We need something similar to |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (7894972): comparison URL. Overall result: ❌ regressions - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 8.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 3.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 509.672s -> 510.294s (0.12%) |
|
Some regressions on linking-heavy workloads like |
|
|
|
I won't have time to look until next week. |
|
@petrochenkov sure will do. |
ac119d2 to
b8f2284
Compare
|
View all comments
Second PR in #138243
Moves
NativeLib::filenameout ofrmetaintolib.rmeta-linkarchive member that was introduced in the first PR. Filename is a link time only data so requiring a full metadata decode should be avoided. It is stored as(name, filename)pairs keyed by name, the newMetadataLoader::get_rlib_native_lib_filenamespatches it back on decode. Also bumpedMETADATA_VERSIONfrom version 10 to 11. Added also new round trip test and existing bundled-libs tests still pass.