New upstream snapshot.
Debian Janitor
1 year, 6 months ago
18 | 18 |
- golint .
|
19 | 19 |
- go test -cover -race -count=1 -timeout=30s -run .
|
20 | 20 |
- 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
|
22 | 22 |
- 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 |
|
0 | 6 |
golang-github-renekroon-ttlcache (2.9.0+ds-1) unstable; urgency=medium
|
1 | 7 |
|
2 | 8 |
* New upstream release.
|