Comments (3)
Performance patches & benchmark results are available.
TL;DR
the performance could be pretty decent, but having multiple Data Channel opened on the same Peer Connection may result in undefined behaviors, including performance degradation, broken pipe, latency spike, etc.
from transportc.
Benchmark Result
Single Data Channel (Connection)
conn_test.go:300: 1KB Test, 10000 round(s), Bw: 42MB/s, Lat: 24.11us
conn_test.go:300: 2KB Test, 10000 round(s), Bw: 60MB/s, Lat: 33.84us
conn_test.go:300: 4KB Test, 10000 round(s), Bw: 77MB/s, Lat: 52.85us
conn_test.go:300: 8KB Test, 10000 round(s), Bw: 92MB/s, Lat: 88.21us
Multiple Data Channels (Connections)
conn_test.go:401: 10 Connections, 1KB Test, 1000 round(s) each, Bw: 46MB/s, Lat: 216us
conn_test.go:401: 10 Connections, 2KB Test, 1000 round(s) each, Bw: 61MB/s, Lat: 326us
conn_test.go:401: 10 Connections, 4KB Test, 1000 round(s) each, Bw: 75MB/s, Lat: 533us
conn_test.go:401: 10 Connections, 8KB Test, 1000 round(s) each, Bw: 89MB/s, Lat: 895us
conn_test.go:401: 20 Connections, 1KB Test, 500 round(s) each, Bw: 47MB/s, Lat: 432us
conn_test.go:401: 20 Connections, 2KB Test, 500 round(s) each, Bw: 60MB/s, Lat: 673us
conn_test.go:401: 20 Connections, 4KB Test, 500 round(s) each, Bw: 72MB/s, Lat: 1109us
conn_test.go:401: 20 Connections, 8KB Test, 500 round(s) each, Bw: 88MB/s, Lat: 1822us
from transportc.
Longer Analysis
Using multiple data channels (connections) DOES NOT introduce theoretical performance difference in terms of throughput, but brings NEGATIVE impact on latency: Multiplexing 10 connections on 1 WebRTC PeerConnection makes the latency per each message transmitted 10x higher comparing to using single data channel. And multiplexing 20 connections results in 20x higher latency.
In addition, multiplexing connections makes WebRTC PeerConnection unstable. With increased number of connections over a single PeerConnection, the chance of SCTP stream breaks and the chance of message transmission having a much greater latency (10x~100x) both increase.
Recommendation: If no compelling reason, should avoid using more connection over one PeerConnection if possible.
from transportc.
Related Issues (8)
- Raw socket operation support HOT 3
- (RVV-B0012) Unused parameter detected in function
- (SCC-SA4006) A value assigned to a variable is never read before being overwritten
- (RVV-B0013) Unused method receiver detected
- Critical Bug in *WebRTConn.LastError() affecting all versions <v0.1.2
- Rework in progress
- Implementation could be vulnerable to DTLS Fingerprinting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transportc.