filter: benchmark: move consts to into benchamrks

This commit is contained in:
Ella Pietraroia 2020-02-10 12:11:20 +10:30
parent c477a1184b
commit a658e39c7c
1 changed files with 23 additions and 0 deletions

View File

@ -69,6 +69,7 @@ func BenchmarkBasic(b *testing.B) {
"testing" "testing"
) )
<<<<<<< HEAD
const ( const (
outBasic = "testout/test_outBasic.mjpeg" outBasic = "testout/test_outBasic.mjpeg"
outDiff = "testout/test_outDiff.mjpeg" outDiff = "testout/test_outDiff.mjpeg"
@ -103,6 +104,19 @@ func BenchmarkBasic(b *testing.B) {
b.Log("\nFrames: ", len(testPackets)) b.Log("\nFrames: ", len(testPackets))
>>>>>>> 60437c8c... filter: benchmark: upadte headers, add consts, print to log >>>>>>> 60437c8c... filter: benchmark: upadte headers, add consts, print to log
======= =======
=======
type d struct {
}
func (d *d) Write(p []byte) (int, error) { return len(p), nil }
func (d *d) Close() error { return nil }
func BenchmarkBasic(b *testing.B) {
const BasicThreshold = 45000
const BasicPixels = 1000
buffer := &d{}
f := NewBasic(buffer, BasicThreshold, BasicPixels)
>>>>>>> 50e83432... filter: benchmark: move consts to into benchamrks
b.Log("Frames: ", len(testPackets)) b.Log("Frames: ", len(testPackets))
>>>>>>> 450df394... filter: benchmark: remove \n from log >>>>>>> 450df394... filter: benchmark: remove \n from log
for n := 0; n < b.N; n++ { for n := 0; n < b.N; n++ {
@ -118,6 +132,9 @@ func BenchmarkBasic(b *testing.B) {
func BenchmarkDifference(b *testing.B) { func BenchmarkDifference(b *testing.B) {
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 50e83432... filter: benchmark: move consts to into benchamrks
const DiffThreshold = 3.0 const DiffThreshold = 3.0
buffer := &d{} buffer := &d{}
f := NewDifference(buffer, DiffThreshold) f := NewDifference(buffer, DiffThreshold)
@ -160,6 +177,9 @@ func BenchmarkDifference(b *testing.B) {
func BenchmarkKNN(b *testing.B) { func BenchmarkKNN(b *testing.B) {
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 50e83432... filter: benchmark: move consts to into benchamrks
const motionDownscaling = 1 const motionDownscaling = 1
const motionInterval = 1 const motionInterval = 1
const KNNMinArea = 25.0 const KNNMinArea = 25.0
@ -201,6 +221,9 @@ func BenchmarkKNN(b *testing.B) {
func BenchmarkMOG(b *testing.B) { func BenchmarkMOG(b *testing.B) {
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 50e83432... filter: benchmark: move consts to into benchamrks
const motionDownscaling = 1 const motionDownscaling = 1
const motionInterval = 1 const motionInterval = 1
const MOGMinArea = 25.0 const MOGMinArea = 25.0