Git Product home page Git Product logo

Comments (3)

gaukas avatar gaukas commented on May 27, 2024

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.

gaukas avatar gaukas commented on May 27, 2024

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.

gaukas avatar gaukas commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.