webrtc-rs/webrtc

[SDP] benchmark the performance of SDP

rainliu opened this issue · 3 comments

add benchmark code for SDP so that we can understand what's performance of SDP

benchmark is added in webrtc-rs/sdp@1f96710

cargo bench

Benchmark Marshal       time:   [4.8741 us 4.8892 us 4.9057 us]                               
                        change: [-2.7654% -2.0874% -1.4044%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 14 outliers among 100 measurements (14.00%)
  5 (5.00%) high mild
  9 (9.00%) high severe

Benchmark Unmarshal     time:   [8.1142 us 8.1243 us 8.1350 us]                                  
                        change: [+0.6471% +1.2217% +1.9205%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 9 outliers among 100 measurements (9.00%)
  5 (5.00%) high mild
  4 (4.00%) high severe

pion sdp https://github.com/pion/sdp/releases/tag/v3.0.4

``
~/Projects/pion/sdp$ go test -bench=.
error message: 12 --> N <-- aN
goos: linux
goarch: amd64
pkg: github.com/pion/sdp/v3
cpu: Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
BenchmarkMarshal-8 339273 4057 ns/op 2064 B/op 53 allocs/op
BenchmarkUnmarshal-8 154941 7632 ns/op 2576 B/op 108 allocs/op
PASS
ok github.com/pion/sdp/v3 2.688s

webrtc-rs sdp benchmark: webrtc-rs/sdp@57bb1af

Gnuplot not found, using plotters backend
Benchmarking Benchmark Marshal
Benchmarking Benchmark Marshal: Warming up for 3.0000 s
Benchmarking Benchmark Marshal: Collecting 100 samples in estimated 5.0057 s (1.0M iterations)
Benchmarking Benchmark Marshal: Analyzing
Benchmark Marshal       time:   [4.6793 us 4.7134 us 4.7577 us]
                        change: [-7.5355% -5.3817% -3.3148%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  4 (4.00%) high mild
  3 (3.00%) high severe

Benchmarking Benchmark Unmarshal 
Benchmarking Benchmark Unmarshal : Warming up for 3.0000 s
Benchmarking Benchmark Unmarshal : Collecting 100 samples in estimated 5.0122 s (616k iterations)
Benchmarking Benchmark Unmarshal : Analyzing
Benchmark Unmarshal     time:   [7.7638 us 7.7890 us 7.8178 us]
                        change: [+0.7135% +1.0075% +1.3136%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 7 outliers among 100 measurements (7.00%)
  5 (5.00%) high mild
  2 (2.00%) high severe