-
-
Notifications
You must be signed in to change notification settings - Fork 328
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 Find
traits
#267
Merged
Merged
Refactor Find
traits
#267
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Byron
force-pushed
the
find-refactor
branch
2 times, most recently
from
December 2, 2021 02:21
3bd9261
to
87930a1
Compare
The plan is to separate pack location entirely from Object and put the location specific functions into a separate trait.
… alter git_odb::Find trait (#266) This will break a lot, but has to happen to prepare these traits for the next generation of object databases.
With the new architecture this can be an implementation detail without forcing it to be Sync.
For completeness in case of single-threaded operations
It could easily be general over all kinds of store as long as there is support for pack-caches, which might be helpful later for the 'final' store type. Ideally, this one now shows how to do it.
With this method it's easier to bypass local caches and control the cache oneself entirely.
We avoid using Bundle and boil it down to what it really needs to be to build packs. Now it should be mostly ready.
This saves virtual method calls and allocations, and probably is cleaner too as one doesn't have to know that the default is a no-op cache.
It's nearly there, but for some reason the boxed dyn traits don't get to be Send even though it's specified.
…utput::count::objects()` (#266) It now is an implementation detail of the Find trait.
With the linked DB this is simply not possible anymore and we expect these updates to happen automatically in future for greater convenience. For now, in order to refresh a repository, one has to reopen it.
This way it's more inline with `Repository::refs`.
As the first step to remove the 'Easy' abstraction.
This great reduction of complexity allows for being multi-threading capabie by default with the option to turn that off at compile time. All `to|into_easy…()` methods are removed in favor of `to_easy()` along with the removal of all `Easy` types in favor of the single `easy::Handle`.
The `easy::Handle` is now a full (but shared) clone of the original Rpeository with additional thread-local state, hence there is no more need for a way to access the original repository.
…::Find*` (#266) These are higher-level and generally more desirable. The Find traits in `git-pack` are more useful internally when packs have to be handled directly, for example when generating packs.
…ke a regression (#266) Could be due to the new implementation going through a refcell, whereas the previous one didn't. That's fair, I guess, it gets quite a few calls, but also means that counting with tree-diff got about 10% slower now that the cache is built-in, maybe. For max-speed, one would probably have a local cache to avoid unnecessary object lookups for previously obtained information alltogether.
It's a tiny bit slower, with or without cache, when going through the handle. It's interesting as it appears going through an Arc is measurable on that level already.
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Untangle and simplify the
Find
traitTasks
contains(oid)
to traitbundle::Location
and if it's worth the effort. If so, see if it can be taken out of theObject
type, which would allow it to move togit-object
.Find
for the linked/static db'static
, too, if they have to be, which means no internalOwnShared
:/, must probably be generic over a Deref implementation like the linked iterator.object-cache
an implementation detail forpack::Find
, and make pack/create.rs enable it.Keep the 'Access' abstraction though, because if this goes,Actually remove it,State
isEasy
, and everything is compile time.cargo smart-release
shows the API in action and it seems like there is an unnecessary layer. The reasonRepository
stays is merely for having something that isSync
.consider making 'single-threadedness' opt-in, basically inverting the meaning ofparallel
. That way, it's the 'right' choice for most applications today, and can be opted in by some with other requirements.