Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

cache: reuse object cache for delta resolution, use LRU policy #514

Merged
merged 3 commits into from
Jul 27, 2017
Merged

cache: reuse object cache for delta resolution, use LRU policy #514

merged 3 commits into from
Jul 27, 2017

Conversation

smola
Copy link
Collaborator

@smola smola commented Jul 27, 2017

No description provided.

c.actualSize += objSize
}

// Get returns an object by its hash. If the object is not found in the cache.
Copy link
Contributor

Choose a reason for hiding this comment

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

If the object is not found in the cache, what happens?

}

// Put puts an object into the cache.
func (c *ObjectLRU) Put(obj plumbing.EncodedObject) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain more what will happen if the object is already into the cache?

dir *dotgit.DotGit
index map[plumbing.Hash]*packfile.Index
}

func newObjectStorage(dir *dotgit.DotGit) (ObjectStorage, error) {
s := ObjectStorage{
dir: dir,
DeltaBaseCache: cache.NewObjectLRU(92 * cache.MiByte),
Copy link
Contributor

Choose a reason for hiding this comment

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

can we put the 92 * cache.MiByte as a constant?

smola added 3 commits July 27, 2017 14:15
* renamed Add to Put
* Get returns a second bool value to indicate if there
  was hit or miss.
Reuse delta base object cache for packfile decoders
across multiple instances.
@codecov
Copy link

codecov bot commented Jul 27, 2017

Codecov Report

Merging #514 into master will decrease coverage by 0.76%.
The diff coverage is 92.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #514      +/-   ##
==========================================
- Coverage   78.42%   77.66%   -0.77%     
==========================================
  Files         128      128              
  Lines        9519     9539      +20     
==========================================
- Hits         7465     7408      -57     
- Misses       1246     1338      +92     
+ Partials      808      793      -15
Impacted Files Coverage Δ
storage/filesystem/object.go 68.91% <100%> (+0.32%) ⬆️
plumbing/format/packfile/decoder.go 80.84% <85.71%> (-0.41%) ⬇️
plumbing/cache/object_lru.go 94.59% <94.59%> (ø)
plumbing/cache/queue.go 0% <0%> (-59.1%) ⬇️
plumbing/transport/ssh/common.go 2.81% <0%> (-47.89%) ⬇️
plumbing/transport/ssh/auth_method.go 33.33% <0%> (-24.77%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 854ffa1...ae1c4f3. Read the comment docs.

@mcuadros mcuadros merged commit 8c57f96 into src-d:master Jul 27, 2017
@smola smola deleted the use-cache-delta branch July 27, 2017 13:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants