-
Notifications
You must be signed in to change notification settings - Fork 4
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
Refactor ResourceIndex
and Associated Methods
#79
Conversation
Benchmark for aee18b1Click to view benchmark
|
Benchmark for cb94ee1Click to view benchmark
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly good, but update_all
might be different from what it was. Not sure about modified
field in the IndexUpdate
struct. Overall, the index should provide API in terms of resource, not paths. Ideally, the user should not care about locations, only about content.
Also, let's move Track API into separate PR because it should be considered more carefully.
Benchmark for 5d6d084Click to view benchmark
|
82a02c6
to
41d2da4
Compare
Benchmark for 34eac0fClick to view benchmark
|
By the way, let's use squashing and rebasing only before the merge into Otherwise, it's difficult to see what was changed after last review... |
Benchmark for decbfebClick to view benchmark
|
Benchmark for 78d6301Click to view benchmark
|
Benchmark for f78add5Click to view benchmark
|
Benchmark for 1134cc1Click to view benchmark
|
Benchmark for d2cb695Click to view benchmark
|
Actually, we need multiple values in the
And we should not duplicate Last actions points before merging:
|
Benchmark for f08cd2eClick to view benchmark
|
Thanks for catching that.
I renamed I also ran into a bug where the root path prefix wasn't being stripped from the files in some cases. This issue has been fixed. Now, all that's left is to fix the build. A couple of tests are failing only on windows for some reason. I tried to resolve it today but couldn't get it to work. I still need to spend some time on it, because I rely on CI logs for debugging. |
Benchmark for 4705382Click to view benchmark
|
Windows CI error fixed in e0f6e75 |
Benchmark for 2c6d686Click to view benchmark
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Changes: - Refine `rustfmt` style rules to improve code readability and consistency: - Group imports by crate - Use Unix-style newlines - Limit comment width to 80 characters - Add `toolchain: nightly` to the Build CI workflow to support nightly features. - Address several Clippy warnings Signed-off-by: Tarek <[email protected]>
This refactoring includes: - Introduced a `Timestamped<Item>` struct to represent items with their last modified time - Added documentation comments for key structs and public functions - Implemented an `IndexUpdate` struct to encapsulate the results of update operations, detailing resources added and removed during updates. - Developed custom serialization and deserialization methods for `ResourceIndex` - Created a `collisions()` method to identify and return resources with collisions - Added helper functions like `load_or_build_index()` to load the index from the file system or construct a new one if it doesn't exist Signed-off-by: Tarek <[email protected]>
This refactor enhances the organization `fs-index` by: - Relocating unit tests to a dedicated file - Implementing the `for_each_type!` macro, which accepts a list of hash function types and executes a block of code for each type Signed-off-by: Tarek <[email protected]>
…hods - Benchmarks have been defined for all relevant methods of `ResourceIndex` using `criterion` - Update README benchmark example Signed-off-by: Tarek <[email protected]>
Signed-off-by: Tarek <[email protected]>
Signed-off-by: Tarek <[email protected]>
f4ad8df
to
d6b29a0
Compare
Benchmark for 84b9573Click to view benchmark
|
Description
This PR outlines a series of improvements and refactors to the
ResourceIndex
and its associated methods, as discussed in this comment.Changes
ResourceIndex
API to align with the proposed changes discussed in the linked comment.index.rs
.ResourceIndex::update_all()
to rebuild the index and compare it with the old index.id_to_resources
to be of typeHashMap<HashType, Vec<IndexedResource>>
instead ofHashMap<ResourceId, CanonicalPathBuf>
to handle cases where one ID maps to multiple resources due to collisions or identical content.Related Issues:
fs-index
#64: Collision Countingfs-index
: Store relative paths inResourceIndex
mappings #20,fs-index
: Benchmarking Resource Index API #16, Enhancements forfs-index
Crate #31: Various enhancements and fixes related to the index functionalityAdditional Changes:
rustfmt
to wrap long comments.rustfmt
experimental rules.target_os
totarget_family
.Todo:
ark-cli
crate to reflect the changes.fs-index
.README
forfs-index
.fs-index
#64.