Compare commits
14 Commits
6ed67e27a0
...
benchmark
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7eb7d2bfee | ||
|
|
7849f3b000 | ||
|
|
7b4338902b | ||
|
|
87230a215c | ||
|
|
0e404a85b8 | ||
|
|
7ca400ab1d | ||
|
|
fa7131d97a | ||
|
|
0d86fe7c12 | ||
|
|
974a6c6be1 | ||
|
|
fd8a58058e | ||
| 0b51f373d5 | |||
| deb5175f94 | |||
| 7faa683237 | |||
| 3d7702f1c6 |
@@ -31,7 +31,7 @@ func main() {
|
||||
}
|
||||
|
||||
now := time.Now().Format(time.DateOnly)
|
||||
resultFile := path.Join(".", "results", head+"_"+now+".txt")
|
||||
resultFile := path.Join(".", "results", now+"_"+head+".txt")
|
||||
log.Printf("Writing results to %s", resultFile)
|
||||
outFile, err := os.Create(resultFile)
|
||||
if err != nil {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 13663852 90.76 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 9525358 130.7 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 16205492 74.61 ns/op
|
||||
BenchmarkEncodeWithBufferPool-6 8466584 143.2 ns/op
|
||||
BenchmarkEncodeWithoutBufferPool-6 6701893 221.0 ns/op
|
||||
BenchmarkDecodeBufferPool-6 7069999 162.3 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 8.413s
|
||||
@@ -0,0 +1,12 @@
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 16792826 71.92 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 9800792 127.2 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 13066466 79.52 ns/op
|
||||
BenchmarkEncodeWithBufferPool-6 8162733 141.6 ns/op
|
||||
BenchmarkEncodeWithoutBufferPool-6 6148492 272.3 ns/op
|
||||
BenchmarkDecodeBufferPool-6 7300572 170.5 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 10.059s
|
||||
@@ -0,0 +1,13 @@
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 457300 2609 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 2050396 561.0 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 504205 2242 ns/op
|
||||
BenchmarkEncode-6 27733428 44.06 ns/op
|
||||
BenchmarkEncodeWithBufferPool-6 27795820 42.97 ns/op
|
||||
BenchmarkEncodeInto-6 397897166 3.004 ns/op
|
||||
BenchmarkDecode-6 1000000000 0.2653 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 10.935s
|
||||
@@ -0,0 +1,27 @@
|
||||
? smpptester [no test files]
|
||||
? smpptester/benchmark [no test files]
|
||||
? smpptester/client [no test files]
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/encoding
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkGSM7EncodeSimpleASCIIString-6 19589385 67.23 ns/op
|
||||
BenchmarkGSM7EncodeComplexASCIIString-6 3757233 288.3 ns/op
|
||||
BenchmarkGSM7EncodeComplex8nASCIIString-6 2576941 532.0 ns/op
|
||||
BenchmarkGSM7EncodeComplex8nASCIIStringPrealloc-6 2611428 460.3 ns/op
|
||||
PASS
|
||||
ok smpptester/encoding 6.483s
|
||||
? smpptester/lua [no test files]
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 16908814 71.62 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 8895826 125.1 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 13243089 80.48 ns/op
|
||||
BenchmarkEncodeWithBufferPool-6 8433070 139.2 ns/op
|
||||
BenchmarkEncodeWithoutBufferPool-6 7134577 248.2 ns/op
|
||||
BenchmarkDecodeBufferPool-6 6587127 166.0 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 8.296s
|
||||
? smpptester/server [no test files]
|
||||
@@ -0,0 +1,27 @@
|
||||
? smpptester [no test files]
|
||||
? smpptester/benchmark [no test files]
|
||||
? smpptester/client [no test files]
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/encoding
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkGSM7EncodeSimpleASCIIString-6 14935776 76.91 ns/op
|
||||
BenchmarkGSM7EncodeComplexASCIIString-6 3364554 353.1 ns/op
|
||||
BenchmarkGSM7EncodeComplex8nASCIIString-6 1840044 591.6 ns/op
|
||||
BenchmarkGSM7EncodeComplex8nASCIIStringPrealloc-6 2081725 520.4 ns/op
|
||||
PASS
|
||||
ok smpptester/encoding 6.270s
|
||||
? smpptester/lua [no test files]
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 16804492 75.91 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 11214482 134.8 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 15180892 71.99 ns/op
|
||||
BenchmarkEncodeWithBufferPool-6 8587657 139.1 ns/op
|
||||
BenchmarkEncodeWithoutBufferPool-6 5282655 223.4 ns/op
|
||||
BenchmarkDecodeBufferPool-6 6659464 170.4 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 10.264s
|
||||
? smpptester/server [no test files]
|
||||
@@ -0,0 +1,27 @@
|
||||
? smpptester [no test files]
|
||||
? smpptester/benchmark [no test files]
|
||||
? smpptester/client [no test files]
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/encoding
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkGSM7EncodeSimpleASCIIString-6 17371128 63.88 ns/op
|
||||
BenchmarkGSM7EncodeComplexASCIIString-6 4210346 332.9 ns/op
|
||||
BenchmarkGSM7EncodeComplex8nASCIIString-6 2748054 517.4 ns/op
|
||||
BenchmarkGSM7EncodeComplex8nASCIIStringPrealloc-6 2576667 469.9 ns/op
|
||||
PASS
|
||||
ok smpptester/encoding 6.462s
|
||||
? smpptester/lua [no test files]
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 16765892 70.02 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 9238833 119.7 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 15343066 75.22 ns/op
|
||||
BenchmarkEncodeWithBufferPool-6 8445075 139.0 ns/op
|
||||
BenchmarkEncodeWithoutBufferPool-6 5464392 274.3 ns/op
|
||||
BenchmarkDecodeBufferPool-6 6709528 165.3 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 8.739s
|
||||
? smpptester/server [no test files]
|
||||
@@ -0,0 +1,27 @@
|
||||
? smpptester [no test files]
|
||||
? smpptester/benchmark [no test files]
|
||||
? smpptester/client [no test files]
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/encoding
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkGSM7EncodeSimpleASCIIString-6 18785672 65.00 ns/op
|
||||
BenchmarkGSM7EncodeComplexASCIIString-6 4313766 332.7 ns/op
|
||||
BenchmarkGSM7EncodeComplex8nASCIIString-6 2686035 520.9 ns/op
|
||||
BenchmarkGSM7EncodeComplex8nASCIIStringPrealloc-6 2613550 461.0 ns/op
|
||||
PASS
|
||||
ok smpptester/encoding 6.548s
|
||||
? smpptester/lua [no test files]
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 16675815 69.97 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 9622903 120.8 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 15080410 84.43 ns/op
|
||||
BenchmarkEncodeWithBufferPool-6 8589709 138.9 ns/op
|
||||
BenchmarkEncodeWithoutBufferPool-6 6965332 228.4 ns/op
|
||||
BenchmarkDecodeBufferPool-6 7003172 165.4 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 8.384s
|
||||
? smpptester/server [no test files]
|
||||
@@ -0,0 +1,12 @@
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 15687109 91.05 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 11083287 128.9 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 16576201 74.12 ns/op
|
||||
BenchmarkEncodeWithBufferPool-6 7868800 138.1 ns/op
|
||||
BenchmarkEncodeWithoutBufferPool-6 6833810 221.2 ns/op
|
||||
BenchmarkDecodeBufferPool-6 7195328 166.0 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 8.763s
|
||||
@@ -0,0 +1,12 @@
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 14983336 90.65 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 10671728 124.4 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 16471220 75.06 ns/op
|
||||
BenchmarkEncodeWithBufferPool-6 8545360 139.1 ns/op
|
||||
BenchmarkEncodeWithoutBufferPool-6 6794032 224.7 ns/op
|
||||
BenchmarkDecodeBufferPool-6 6737445 165.3 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 8.681s
|
||||
@@ -0,0 +1,28 @@
|
||||
? smpptester [no test files]
|
||||
? smpptester/benchmark [no test files]
|
||||
? smpptester/client [no test files]
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/encoding
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkGSM7EncodeSimpleASCIIString-6 17190692 63.88 ns/op
|
||||
BenchmarkGSM7EncodeComplexASCIIString-6 3987712 302.8 ns/op
|
||||
BenchmarkGSM7EncodeComplex8nASCIIString-6 2563090 523.2 ns/op
|
||||
BenchmarkGSM7EncodeComplex8nASCIIStringPrealloc-6 2615463 462.5 ns/op
|
||||
PASS
|
||||
ok smpptester/encoding 6.235s
|
||||
? smpptester/lua [no test files]
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 16913668 70.22 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 9289608 129.8 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 13000988 83.78 ns/op
|
||||
BenchmarkEncodeWithBufferPool-6 7950153 137.7 ns/op
|
||||
BenchmarkEncodeWithoutBufferPool-6 6290456 172.9 ns/op
|
||||
BenchmarkDecodeBufferPool-6 7194349 162.7 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 7.717s
|
||||
? smpptester/server [no test files]
|
||||
? smpptester/utils [no test files]
|
||||
@@ -1,12 +0,0 @@
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 475929 2495 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 2278720 518.3 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 512766 2334 ns/op
|
||||
BenchmarkEncode-6 8457019 141.4 ns/op
|
||||
BenchmarkEncodeInto-6 396452034 2.999 ns/op
|
||||
BenchmarkDecode-6 1000000000 0.2644 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 8.814s
|
||||
@@ -1,9 +0,0 @@
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 451912 2327 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 2492938 475.8 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 526594 2275 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 4.062s
|
||||
@@ -1,9 +0,0 @@
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
pkg: smpptester/pdu
|
||||
cpu: Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
|
||||
BenchmarkBufferPoolManager-6 451069 2297 ns/op
|
||||
BenchmarkBufferPoolManager_Concurrent-6 2471343 482.9 ns/op
|
||||
BenchmarkBufferPoolManager_Memory-6 576630 2408 ns/op
|
||||
PASS
|
||||
ok smpptester/pdu 5.321s
|
||||
@@ -450,3 +450,43 @@ func TestSizeReturns16(t *testing.T) {
|
||||
t.Errorf("Expected size to be 16, got %d", p.Size())
|
||||
}
|
||||
}
|
||||
|
||||
// region benchmarks
|
||||
|
||||
// With buffer pool
|
||||
func BenchmarkEncode(b *testing.B) {
|
||||
p := &PDU_HEADER{
|
||||
command_length: 16,
|
||||
command_id: 1,
|
||||
command_status: 0,
|
||||
sequence_number: 12345,
|
||||
}
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
p.Encode()
|
||||
}
|
||||
}
|
||||
|
||||
// Without buffer pool
|
||||
func BenchmarkEncodeInto(b *testing.B) {
|
||||
p := &PDU_HEADER{
|
||||
command_length: 16,
|
||||
command_id: 1,
|
||||
command_status: 0,
|
||||
sequence_number: 12345,
|
||||
}
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
buf := make([]uint8, 16)
|
||||
p.EncodeInto(&buf)
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkDecode(b *testing.B) {
|
||||
p := &PDU_HEADER{}
|
||||
data := []uint8{0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3}
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
p.Decode(data)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user