feat: Windows notifications, benchmarks, GPG signing, docs site, one-liner installers
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
package dedup
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func BenchmarkShouldIgnoreNewContent(b *testing.B) {
|
||||
f := NewFilter("machine-a")
|
||||
payload := Payload{
|
||||
Text: "benchmark content string",
|
||||
Ts: time.Now().UnixNano(),
|
||||
Origin: "machine-b",
|
||||
}
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_ = f.ShouldIgnore(payload)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkShouldIgnoreImage(b *testing.B) {
|
||||
f := NewFilter("machine-a")
|
||||
payload := Payload{
|
||||
Mime: "image/png",
|
||||
Data: "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
|
||||
Ts: time.Now().UnixNano(),
|
||||
Origin: "machine-b",
|
||||
}
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
_ = f.ShouldIgnore(payload)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkMarkWritten(b *testing.B) {
|
||||
f := NewFilter("machine-a")
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
f.MarkWritten("some clipboard text")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user