benchmarks

package
v2.0.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 4 Imported by: 0

README

Cowrie Benchmarks

Performance benchmarks for Cowrie codec implementations.

Running Benchmarks

Go
cd go
go test -bench=. -benchmem ../benchmarks/
Python
cd python
python ../benchmarks/bench_python.py
Rust
cd rust
cargo bench

Benchmark Categories

  1. Encode/Decode Speed - Operations per second for various payload sizes
  2. Payload Size - Compressed size vs JSON
  3. Memory Usage - Allocations during encode/decode
  4. Graph Types - Performance of new v2.1 graph types

Expected Results

Throughput (approximate)
Implementation Gen1 Encode Gen1 Decode Gen2 Encode Gen2 Decode
Go ~500 MB/s ~600 MB/s ~300 MB/s ~400 MB/s
Rust ~450 MB/s ~550 MB/s ~250 MB/s ~350 MB/s
Python ~15 MB/s ~20 MB/s ~8 MB/s ~12 MB/s
Payload Size Savings
Payload Type JSON Gen1 Gen2
Small object 100% ~90% ~85%
Large array (repeated keys) 100% ~85% ~60%
Float array 100% ~50% ~50%

Gen2 shows best savings with repeated object keys due to dictionary coding.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BenchmarkGen1DecodeLarge

func BenchmarkGen1DecodeLarge(b *testing.B)

func BenchmarkGen1DecodeSmall

func BenchmarkGen1DecodeSmall(b *testing.B)

func BenchmarkGen1EncodeFloatArray

func BenchmarkGen1EncodeFloatArray(b *testing.B)

func BenchmarkGen1EncodeLarge

func BenchmarkGen1EncodeLarge(b *testing.B)

func BenchmarkGen1EncodeMedium

func BenchmarkGen1EncodeMedium(b *testing.B)

func BenchmarkGen1EncodeSmall

func BenchmarkGen1EncodeSmall(b *testing.B)

func BenchmarkGen2DecodeLargeArray

func BenchmarkGen2DecodeLargeArray(b *testing.B)

func BenchmarkGen2DecodeSmall

func BenchmarkGen2DecodeSmall(b *testing.B)

func BenchmarkGen2EncodeGraphShard

func BenchmarkGen2EncodeGraphShard(b *testing.B)

func BenchmarkGen2EncodeLargeArray

func BenchmarkGen2EncodeLargeArray(b *testing.B)

func BenchmarkGen2EncodeSmall

func BenchmarkGen2EncodeSmall(b *testing.B)

func BenchmarkJSONDecodeLarge

func BenchmarkJSONDecodeLarge(b *testing.B)

func BenchmarkJSONDecodeSmall

func BenchmarkJSONDecodeSmall(b *testing.B)

func BenchmarkJSONEncodeLarge

func BenchmarkJSONEncodeLarge(b *testing.B)

func BenchmarkJSONEncodeSmall

func BenchmarkJSONEncodeSmall(b *testing.B)

func TestPayloadSizes

func TestPayloadSizes(t *testing.T)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL