Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
Merge pull request #20 from ipfs/fix/use-2q
Browse files Browse the repository at this point in the history
cache: switch to 2q
  • Loading branch information
Stebalien committed Aug 20, 2019
2 parents 8d6a694 + b40a71c commit 4733550
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 88 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ env:
global:
- GOTFLAGS="-race"
matrix:
- BUILD_DEPTYPE=gx
- BUILD_DEPTYPE=gomod


Expand All @@ -24,7 +23,6 @@ script:

cache:
directories:
- $GOPATH/src/gx
- $GOPATH/pkg/mod
- $HOME/.cache/go-build

Expand Down
18 changes: 0 additions & 18 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions arc_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ type cacheSize int
// block Cids. This provides block access-time improvements, allowing
// to short-cut many searches without query-ing the underlying datastore.
type arccache struct {
arc *lru.ARCCache
arc *lru.TwoQueueCache
blockstore Blockstore

hits metrics.Counter
total metrics.Counter
}

func newARCCachedBS(ctx context.Context, bs Blockstore, lruSize int) (*arccache, error) {
arc, err := lru.NewARC(lruSize)
arc, err := lru.New2Q(lruSize)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion bloom_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (b *bloomcache) Has(k cid.Cid) (bool, error) {
}

func (b *bloomcache) GetSize(k cid.Cid) (int, error) {
return b.blockstore.GetSize(k)
return b.blockstore.GetSize(k)
}

func (b *bloomcache) Get(k cid.Cid) (blocks.Block, error) {
Expand Down
65 changes: 0 additions & 65 deletions package.json

This file was deleted.

0 comments on commit 4733550

Please sign in to comment.