Codebase list golang-github-renekroon-ttlcache / 77d568d
New upstream snapshot. Debian Janitor 2 years ago
3 changed file(s) with 44 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
1818 - golint .
1919 - go test -cover -race -count=1 -timeout=30s -run .
2020 - go test -covermode=count -coverprofile=coverage.out -timeout=90s -run .
21 - '[ ! -z "$COVERALLS_TOKEN" ] && $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN'
21 - if [ "$TRAVIS_BRANCH" = "master" ]; then $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN; fi
2222 - cd bench; go test -run=Bench.* -bench=. -benchmem; cd ..
0 package bench
1
2 import (
3 "fmt"
4 "testing"
5 "time"
6
7 ttlcache "github.com/ReneKroon/ttlcache/v2"
8 )
9
10 func BenchmarkCacheSetWithoutTTL(b *testing.B) {
11 cache := ttlcache.NewCache()
12 defer cache.Close()
13
14 for n := 0; n < b.N; n++ {
15 cache.Set(fmt.Sprint(n%1000000), "value")
16 }
17 }
18
19 func BenchmarkCacheSetWithGlobalTTL(b *testing.B) {
20 cache := ttlcache.NewCache()
21 defer cache.Close()
22
23 cache.SetTTL(time.Duration(50 * time.Millisecond))
24 for n := 0; n < b.N; n++ {
25 cache.Set(fmt.Sprint(n%1000000), "value")
26 }
27 }
28
29 func BenchmarkCacheSetWithTTL(b *testing.B) {
30 cache := ttlcache.NewCache()
31 defer cache.Close()
32
33 for n := 0; n < b.N; n++ {
34 cache.SetWithTTL(fmt.Sprint(n%1000000), "value", time.Duration(50*time.Millisecond))
35 }
36 }
0 golang-github-renekroon-ttlcache (2.9.0+ds+git20211107.1.6eff24f-1) UNRELEASED; urgency=low
1
2 * New upstream snapshot.
3
4 -- Debian Janitor <janitor@jelmer.uk> Wed, 17 Nov 2021 13:03:05 -0000
5
06 golang-github-renekroon-ttlcache (2.9.0+ds-1) unstable; urgency=medium
17
28 * New upstream release.