-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.O-aixOS: Big Blue's Advanced Interactive eXecutive..OS: Big Blue's Advanced Interactive eXecutive..T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Description
Currently in the bootstrap we are reading the entire archive into memory inorder to read the members:
fn is_aix_shared_archive(path: &Path) -> bool {
// reading the entire file as &[u8] into memory seems excessive
// look into either mmap it or use the &CacheReader
let data = match fs::read(path) {
Ok(data) => data,
Err(_) => return false,
};
let file = match ArchiveFile::parse(&*data) {
Ok(file) => file,
Err(_) => return false,
};
file.members()
.filter_map(Result::ok)
.any(|entry| String::from_utf8_lossy(entry.name()).contains(".so"))
}
Find an easy way to either memory map the file or something else. Because currently this can take up to a second or two to read the larger dylibs into memory.
jieyouxu and mustartt
Metadata
Metadata
Assignees
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.O-aixOS: Big Blue's Advanced Interactive eXecutive..OS: Big Blue's Advanced Interactive eXecutive..T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)