Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a FileDataSource that fetches archive files from local disk #34

Merged
merged 2 commits into from
Oct 19, 2023

Conversation

elliottslaughter
Copy link
Contributor

The intended use case is to be able to "attach" to archives that happen to be located on a local disk, e.g.:

legion_prof --attach legion_prof.0 legion_prof.1

So you no longer have to host these over a webserver if you don't want to.

src/file_data.rs Outdated Show resolved Hide resolved
src/file_data.rs Outdated Show resolved Hide resolved
) -> SlotMetaTile {
let req = TileRequestRef { entry_id, tile_id };
let mut path = self.basedir.join("slot_meta_tile");
path.push(&req.to_slug());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the mut could be ditched in these cases too, if desired

let path = self.basedir.join("slot_meta_tile").join(&req.to_slug());

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I didn't write this because I'm not 100% sure the Rust compiler can optimize away the extra allocation, but maybe writing this in a perfectly allocation-optimal way isn't actually necessary...

I'll plan to keep it for now, though maybe it's something one of us could look into.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW My personal going-in position would be to prioritize immutability in the code as much as possible, over perfectly minimal allocations, especially in a GUI that only needs to cater to (slow) human response times (until/unless a need for specific optimization is demonstrated).

@elliottslaughter elliottslaughter merged commit 9d587fb into master Oct 19, 2023
12 checks passed
@elliottslaughter elliottslaughter deleted the file-data-source branch October 19, 2023 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants