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

cache: switch to 2q #20

Merged
merged 3 commits into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.