diff --git a/CHANGES.md b/CHANGES.md index edcb8bd..d5fa3da 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,66 @@ # Change Log +## Version 0.1.0 + +**24.10.2026** + +**๐Ÿงช The first beta: the API follows the specifications and is ready to build on, while compatibility between versions isn't guaranteed until 1.0.0** + +**โšก Data channels move 1.2โ€“2.1 Gbps, 7.7โ€“14.6x aiortc's throughput at 10โ€“15% of its CPU per MB. See the [benchmarks](https://wrtc.marshal.dev/benchmarks/)** + +**๐Ÿš€ A data channel opens 3.5 ms after `createOffer`, 7โ€“8x faster than aiortc, and `getStats` takes 1.7 instead of 4.2 ms** + +**๐ŸŽฅ Simulcast for every encoder, and H.264 on macOS that recovers from encoder faults and falls back to OpenH264** + +**๐Ÿงญ Transceiver, ICE, SCTP and track state change with the events that report them, as in browsers** + +**๐Ÿงฉ [Examples](https://wrtc.marshal.dev/examples/) of a server for a browser page, a Gemini Live voice agent, and WHIP/WHEP streams** + +* Add simulcast for every encoder, on Windows too: each layer is sent in the negotiated codec at its scaled size, whether or not the encoder does simulcast itself. VP9 and AV1 need a `scalabilityMode` such as `L1T1` for each layer by [@MarshalX](https://github.com/MarshalX) in [#254](https://github.com/MarshalX/python-webrtc/pull/254) +* Fall back to OpenH264, once `await webrtc.openh264.install()` has run, when VideoToolbox can't encode or decode by [@MarshalX](https://github.com/MarshalX) in [#254](https://github.com/MarshalX/python-webrtc/pull/254) +* Show transceiver, ICE, SCTP and track state with the events that change them: `mid`, `currentDirection` and the selected candidate pair change when their event fires, not before by [@MarshalX](https://github.com/MarshalX) in [#259](https://github.com/MarshalX/python-webrtc/pull/259) +* Add a Python server for a browser page example: your camera comes back in grayscale, and Python answers a chat over a data channel by [@MarshalX](https://github.com/MarshalX) in [#268](https://github.com/MarshalX/python-webrtc/pull/268) +* Add a Gemini Live voice agent example, with the API key kept on the server by [@MarshalX](https://github.com/MarshalX) in [#268](https://github.com/MarshalX/python-webrtc/pull/268) +* Add a WHIP/WHEP example that plays a live stream in the terminal or publishes one by [@MarshalX](https://github.com/MarshalX) in [#268](https://github.com/MarshalX/python-webrtc/pull/268) +* Add llms.txt, Markdown versions of the docs pages and Context7 and DeepWiki configs by [@MarshalX](https://github.com/MarshalX) in [#265](https://github.com/MarshalX/python-webrtc/pull/265) +* Credit node-webrtc in the third-party licences by [@MarshalX](https://github.com/MarshalX) in [#262](https://github.com/MarshalX/python-webrtc/pull/262) +* Speed up connection setup: keep libsrtp initialized and the network list updated, start the network manager and create port allocators without waiting on the network thread by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Speed up the first connection by running libsrtp's self-tests on their own thread by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Gather a candidate pool without waits between phases, and add ICE candidates in one signaling task by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Cut thread hops from negotiation and `getStats`, and share concurrent `getStats` calls: 20 of them take 5.7 instead of 80.9 ms, renegotiation 22% less time and warm setup with trickle 18% less by [@MarshalX](https://github.com/MarshalX) in [#255](https://github.com/MarshalX/python-webrtc/pull/255) +* Cut signaling-thread waits from getters: `transceiver.mid` takes 1.0 instead of 9.8 ยตs, `sender.track` 38% less time, `getSelectedCandidatePair()` 46% less and renegotiation 15% less by [@MarshalX](https://github.com/MarshalX) in [#259](https://github.com/MarshalX/python-webrtc/pull/259) +* Speed up data channels on macOS and Linux with a second, connected socket for a busy peer. Set the `PythonWebRTC-ConnectedSockets` field trial to `Disabled` to turn it off by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Speed up data channel sends with one network-thread task per send, and skip the local address lookup on every UDP packet by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Convert received data channel messages once and deliver them with less Python per message by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Copy data channel messages once: 10โ€“11% more throughput and 7โ€“11% less CPU per MB for 1 KB messages by [@MarshalX](https://github.com/MarshalX) in [#252](https://github.com/MarshalX/python-webrtc/pull/252) +* Speed up event delivery, skip wake-ups while the event loop drains, and cache session descriptions between the events that change them by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Drop the unused audio processing and video render smoothing, which cost CPU on every received stream by [@MarshalX](https://github.com/MarshalX) in [#249](https://github.com/MarshalX/python-webrtc/pull/249) +* Send VP8 and H.264 at 720p with 6โ€“9% less CPU per frame by [@MarshalX](https://github.com/MarshalX) in [#256](https://github.com/MarshalX/python-webrtc/pull/256) +* Wrap NV12 frames without copies, pass NV12 to VideoToolbox as it is, and pool frame buffers by [@MarshalX](https://github.com/MarshalX) in [#257](https://github.com/MarshalX/python-webrtc/pull/257) +* Copy video frame data once into pooled buffers, and convert VideoToolbox output to I420 in one pass by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Copy encoded frames less and cache RTP sources: 14% less CPU per transformed frame, `getSynchronizationSources()` in 1.3 instead of 14.8 ยตs. A transform now queues up to 60 unread frames instead of 120 by [@MarshalX](https://github.com/MarshalX) in [#258](https://github.com/MarshalX/python-webrtc/pull/258) +* Fix sockets raising SIGPIPE on macOS, which kills the process where its default handler is restored by [@MarshalX](https://github.com/MarshalX) in [#267](https://github.com/MarshalX/python-webrtc/pull/267) +* Fix data channel stalls under load: UDP sockets get a receive buffer of at least 8 MB, which `WebRTC-SetSocketReceiveBuffer` overrides. On Linux, raise `net.core.rmem_max` to allow it. See [Field trials](https://wrtc.marshal.dev/guides/field-trials/) by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Fix a VideoToolbox frame that fails after the encoder took it: the session restarts with a key frame by [@MarshalX](https://github.com/MarshalX) in [#254](https://github.com/MarshalX/python-webrtc/pull/254) +* Fix a connection kept alive after `close()` by the event loop it was bound to while closing by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Fix the operations of a closed event loop keeping their connections alive by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Fix the next operation starting before the code awaiting the previous one resumes, as in browsers by [@MarshalX](https://github.com/MarshalX) in [#259](https://github.com/MarshalX/python-webrtc/pull/259) +* Fix `addIceCandidate` without a remote description rejecting late; it now rejects at once by [@MarshalX](https://github.com/MarshalX) in [#261](https://github.com/MarshalX/python-webrtc/pull/261) +* Fix sends that fail as the remote end closes: they fire `error` with `data-channel-failure`, and their bytes stay in `bufferedAmount` by [@MarshalX](https://github.com/MarshalX) in [#252](https://github.com/MarshalX/python-webrtc/pull/252) +* Fix remote data channels collected before their `open` event by [@MarshalX](https://github.com/MarshalX) in [#259](https://github.com/MarshalX/python-webrtc/pull/259) +* Fix DTMF tones and gaps raised to longer minimums than the specification's by [@MarshalX](https://github.com/MarshalX) in [#253](https://github.com/MarshalX/python-webrtc/pull/253) +* Fix standalone ICE gathering waiting 1 s between phases and gathering passive TCP candidates, and gather IPv6 where the host has it by [@MarshalX](https://github.com/MarshalX) in [#253](https://github.com/MarshalX/python-webrtc/pull/253) +* Fix the end of candidates of an earlier remote description shown after an ICE restart by [@MarshalX](https://github.com/MarshalX) in [#253](https://github.com/MarshalX/python-webrtc/pull/253) +* Fix the audio capture time, so the jitter doesn't jump after a send pause by [@MarshalX](https://github.com/MarshalX) in [#253](https://github.com/MarshalX/python-webrtc/pull/253) +* Fix `VideoTrackGenerator` frames written back to back dropped as duplicates by [@MarshalX](https://github.com/MarshalX) in [#256](https://github.com/MarshalX/python-webrtc/pull/256) +* Fix relayed remote video not scaled down for its encoder at low bitrates, and a sent track's own sinks getting the encoder's smaller frames by [@MarshalX](https://github.com/MarshalX) in [#256](https://github.com/MarshalX/python-webrtc/pull/256) +* Fix encoded frames a transform drops staying in memory while the event loop is busy or closed by [@MarshalX](https://github.com/MarshalX) in [#260](https://github.com/MarshalX/python-webrtc/pull/260) +* Fix writes to a writable stream slowing down as its queue grows by [@MarshalX](https://github.com/MarshalX) in [#264](https://github.com/MarshalX/python-webrtc/pull/264) +* Fix the empty reason in the OpenAI example's connection error by [@MarshalX](https://github.com/MarshalX) in [#264](https://github.com/MarshalX/python-webrtc/pull/264) +* Fix the OpenAI example printing the API key in `--help` by [@MarshalX](https://github.com/MarshalX) in [#268](https://github.com/MarshalX/python-webrtc/pull/268) +* Fix the memory benchmark table when a run stops early at the memory limit, and benchmark charts crashing on a zero value or baseline by [@MarshalX](https://github.com/MarshalX) in [#264](https://github.com/MarshalX/python-webrtc/pull/264) +* Fix the connections guide's advice to wait for complete ICE gathering, which can take about 40 seconds with a STUN server by [@MarshalX](https://github.com/MarshalX) in [#268](https://github.com/MarshalX/python-webrtc/pull/268) + ## Version 0.0.2 **15.10.2026** diff --git a/README.md b/README.md index ec98f16..2bcc9c0 100644 --- a/README.md +++ b/README.md @@ -100,8 +100,8 @@ equal to the strings of the specification, dictionaries are typed dataclasses, a | VP9 and AV1 | โœ… | โŒ | โœ… | โœ… | | `pip install` on Linux, macOS and Windows | โœ… | โœ… | โœ… | โŒ system packages | -Against aiortc, it opens connections 7โ€“8x faster, moves 4.4โ€“9x more data through a data channel and spends less CPU on -audio. See the [benchmarks](https://wrtc.marshal.dev/benchmarks/), which also measure Pion, libdatachannel and +Against aiortc, it opens connections 7โ€“8x faster, moves 7.7โ€“14.6x more data through a data channel and spends less +CPU on audio. See the [benchmarks](https://wrtc.marshal.dev/benchmarks/), which also measure Pion, libdatachannel and webrtc-rs. ## Codecs diff --git a/benchmarks/RESULTS.md b/benchmarks/RESULTS.md index 561f05d..b56369c 100644 --- a/benchmarks/RESULTS.md +++ b/benchmarks/RESULTS.md @@ -19,7 +19,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). | Library | Create | Offer created | Gathered | ICE connected | Connected | Data channel open | Open, % of aiortc | | --- | --- | --- | --- | --- | --- | --- | --- | -| wrtc 0.0.3 | 0.5 / 0.5 | 0.2 / 0.3 | 1.2 / 1.3 | 3.0 / 3.2 | 3.4 / 3.6 | 3.5 / 3.7 | 12% | +| wrtc 0.1.0 | 0.5 / 0.5 | 0.2 / 0.3 | 1.2 / 1.3 | 3.0 / 3.2 | 3.4 / 3.6 | 3.5 / 3.7 | 12% | | aiortc 1.15.0 | 0.3 / 0.3 | 0.1 / 0.1 | 2.1 / 2.6 | 26.7 / 27.5 | 28.1 / 28.9 | 29.0 / 29.9 | 100% | | pion v4.2.23 | 0.8 / 1.4 | 1.9 / 2.7 | 3.5 / 4.4 | 36.5 / 89.0 | 39.1 / 94.5 | 39.6 / 95.4 | 136% | | libdatachannel 0.24.6 | 0.0 / 0.0 | 0.1 / 0.3 | 0.2 / 0.4 | 1.0 / 1.8 | 2.1 / 4.0 | 2.3 / 4.3 | 8% | @@ -29,7 +29,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). | Library | Create | Offer created | Gathered | ICE connected | Connected | Data channel open | Open, % of aiortc | | --- | --- | --- | --- | --- | --- | --- | --- | -| wrtc 0.0.3 | 2.3 / 4.0 | 0.3 / 0.3 | 1.3 / 1.5 | 3.7 / 4.0 | 4.3 / 4.8 | 4.3 / 4.8 | 13% | +| wrtc 0.1.0 | 2.3 / 4.0 | 0.3 / 0.3 | 1.3 / 1.5 | 3.7 / 4.0 | 4.3 / 4.8 | 4.3 / 4.8 | 13% | | aiortc 1.15.0 | 3.6 / 15.8 | 0.1 / 0.1 | 2.2 / 2.6 | 27.4 / 27.5 | 32.8 / 37.8 | 33.9 / 38.7 | 100% | | pion v4.2.23 | 0.4 / 0.8 | 0.8 / 1.6 | 1.5 / 2.8 | 18.6 / 78.7 | 20.1 / 82.7 | 20.6 / 84.2 | 60% | | libdatachannel 0.24.6 | 1.5 / 11.5 | 4.8 / 6.2 | 4.9 / 6.2 | 7.7 / 9.2 | 10.5 / 11.7 | 10.9 / 11.9 | 32% | @@ -39,7 +39,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). | Library | Create | Offer created | Gathered | ICE connected | Connected | Data channel open | Open, % of aiortc | | --- | --- | --- | --- | --- | --- | --- | --- | -| wrtc 0.0.3 | 0.5 / 0.7 | 0.2 / 0.2 | 0.8 / 1.1 | 3.0 / 3.9 | 3.5 / 4.3 | 3.6 / 4.4 | 12% | +| wrtc 0.1.0 | 0.5 / 0.7 | 0.2 / 0.2 | 0.8 / 1.1 | 3.0 / 3.9 | 3.5 / 4.3 | 3.6 / 4.4 | 12% | | aiortc 1.15.0 | 0.3 / 0.3 | 0.1 / 0.1 | 2.1 / 2.5 | 26.7 / 27.6 | 28.1 / 29.0 | 29.0 / 30.0 | 100% | | pion v4.2.23 | 0.8 / 1.4 | 1.9 / 2.8 | 3.6 / 4.4 | 46.7 / 47.9 | 48.5 / 49.9 | 49.4 / 50.7 | 170% | | libdatachannel 0.24.6 | 0.0 / 0.0 | 0.2 / 0.3 | 0.2 / 0.2 | 1.0 / 2.0 | 2.2 / 3.5 | 2.3 / 3.7 | 8% | @@ -49,7 +49,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). | Library | Create | Offer created | Gathered | ICE connected | Connected | Data channel open | Open, % of aiortc | | --- | --- | --- | --- | --- | --- | --- | --- | -| wrtc 0.0.3 | 2.3 / 2.4 | 0.3 / 0.3 | 1.1 / 1.1 | 4.0 / 4.4 | 4.4 / 4.9 | 4.6 / 5.0 | 13% | +| wrtc 0.1.0 | 2.3 / 2.4 | 0.3 / 0.3 | 1.1 / 1.1 | 4.0 / 4.4 | 4.4 / 4.9 | 4.6 / 5.0 | 13% | | aiortc 1.15.0 | 3.5 / 3.7 | 0.1 / 0.1 | 2.2 / 2.3 | 27.4 / 27.5 | 32.7 / 33.0 | 33.7 / 34.0 | 100% | | pion v4.2.23 | 0.4 / 3.9 | 0.7 / 4.6 | 1.2 / 8.2 | 20.9 / 36.6 | 22.3 / 37.9 | 22.7 / 38.6 | 67% | | libdatachannel 0.24.6 | 0.8 / 1.5 | 2.7 / 5.4 | 2.6 / 5.3 | 4.3 / 8.0 | 5.8 / 10.6 | 6.1 / 11.0 | 18% | @@ -59,7 +59,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). | Library | CPU, both (ms) | Peak RSS, offerer (MB) | Loop lag p95 (ms) | Failed trials | | --- | --- | --- | --- | --- | -| wrtc 0.0.3 | 10.8 | 55 | 0.3 | 0 | +| wrtc 0.1.0 | 10.8 | 55 | 0.3 | 0 | | aiortc 1.15.0 | 11.7 | 71 | 0.8 | 0 | | pion v4.2.23 | 98.3 | 23 | - | 0 | | libdatachannel 0.24.6 | 4.7 | 10 | - | 0 | @@ -71,7 +71,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). ### Throughput (Mbps) -| Flood | wrtc 0.0.3 | aiortc 1.15.0 | pion v4.2.23 | libdatachannel 0.24.6 | webrtc-rs 0.21.1 | wrtc, % of aiortc | pion, % of aiortc | libdatachannel, % of aiortc | webrtc-rs, % of aiortc | +| Flood | wrtc 0.1.0 | aiortc 1.15.0 | pion v4.2.23 | libdatachannel 0.24.6 | webrtc-rs 0.21.1 | wrtc, % of aiortc | pion, % of aiortc | libdatachannel, % of aiortc | webrtc-rs, % of aiortc | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | ordered 1 KB x1 | 1215 | 90 | 517 | 478 | 684 | 1353% | 575% | 532% | 762% | | ordered 1 KB x10 | 1282 | 95 | 1058 | 1039 | 1260 | 1353% | 1117% | 1097% | 1330% | @@ -84,7 +84,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). ### Message rate (messages/s) -| Flood | wrtc 0.0.3 | aiortc 1.15.0 | pion v4.2.23 | libdatachannel 0.24.6 | webrtc-rs 0.21.1 | wrtc, % of aiortc | pion, % of aiortc | libdatachannel, % of aiortc | webrtc-rs, % of aiortc | +| Flood | wrtc 0.1.0 | aiortc 1.15.0 | pion v4.2.23 | libdatachannel 0.24.6 | webrtc-rs 0.21.1 | wrtc, % of aiortc | pion, % of aiortc | libdatachannel, % of aiortc | webrtc-rs, % of aiortc | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | ordered 1 KB x1 | 148350 | 10964 | 63078 | 58348 | 83512 | 1353% | 575% | 532% | 762% | | ordered 1 KB x10 | 156464 | 11562 | 129161 | 126857 | 153778 | 1353% | 1117% | 1097% | 1330% | @@ -99,7 +99,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). - % below 100 is cheaper. -| Flood | wrtc 0.0.3 | aiortc 1.15.0 | pion v4.2.23 | libdatachannel 0.24.6 | webrtc-rs 0.21.1 | wrtc, % of aiortc | pion, % of aiortc | libdatachannel, % of aiortc | webrtc-rs, % of aiortc | +| Flood | wrtc 0.1.0 | aiortc 1.15.0 | pion v4.2.23 | libdatachannel 0.24.6 | webrtc-rs 0.21.1 | wrtc, % of aiortc | pion, % of aiortc | libdatachannel, % of aiortc | webrtc-rs, % of aiortc | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | ordered 1 KB x1 | 20 | 132 | 82 | 62 | 13 | 15% | 62% | 47% | 10% | | ordered 1 KB x10 | 19 | 127 | 54 | 52 | 34 | 15% | 43% | 41% | 27% | @@ -114,7 +114,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). | Library | RTT p50 / p95 (ms) | Lost | p50, % of aiortc | | --- | --- | --- | --- | -| wrtc 0.0.3 | 0.6 / 0.8 | 0 | 48% | +| wrtc 0.1.0 | 0.6 / 0.8 | 0 | 48% | | aiortc 1.15.0 | 1.2 / 1.7 | 0 | 100% | | pion v4.2.23 | 0.5 / 0.9 | 0 | 46% | | libdatachannel 0.24.6 | 0.5 / 0.7 | 0 | 39% | @@ -131,7 +131,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). | Library | Baseline (MB) | Created (KB) | Data channel (KB) | Audio (KB) | Created, % of aiortc | Data channel, % of aiortc | Audio, % of aiortc | | --- | --- | --- | --- | --- | --- | --- | --- | -| wrtc 0.0.3 | 92 | 146 | 814 | 1701 | 335% | 166% | 129% | +| wrtc 0.1.0 | 92 | 146 | 814 | 1701 | 335% | 166% | 129% | | aiortc 1.15.0 | 128 | 44 | 491 | 1322 | 100% | 100% | 100% | | pion v4.2.23 | 28 | 94 | 3323 | 2795 | 216% | 677% | 212% | | libdatachannel 0.24.6 | 5 | 22 | 771 | - | 51% | 157% | - | @@ -141,7 +141,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). | Library | Created | Data channel | Audio | | --- | --- | --- | --- | -| wrtc 0.0.3 | 36.7 | 195.1 | 376.1 | +| wrtc 0.1.0 | 36.7 | 195.1 | 376.1 | | aiortc 1.15.0 | 14.2 | 108.3 | 227.9 | | pion v4.2.23 | 22.6 | 680.3 | 594.2 | | libdatachannel 0.24.6 | 13.8 | 168.9 | - | @@ -151,9 +151,9 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). | Library | State | 1 | 10 | 50 | 100 | 200 | | --- | --- | --- | --- | --- | --- | --- | -| wrtc 0.0.3 | created | 99 | 100 | 106 | 113 | 128 | -| wrtc 0.0.3 | datachannel | 103 | 111 | 145 | 185 | 266 | -| wrtc 0.0.3 | audio | 105 | 123 | 192 | 276 | 445 | +| wrtc 0.1.0 | created | 99 | 100 | 106 | 113 | 128 | +| wrtc 0.1.0 | datachannel | 103 | 111 | 145 | 185 | 266 | +| wrtc 0.1.0 | audio | 105 | 123 | 192 | 276 | 445 | | aiortc 1.15.0 | created | 134 | 135 | 136 | 138 | 143 | | aiortc 1.15.0 | datachannel | 137 | 142 | 162 | 186 | 235 | | aiortc 1.15.0 | audio | 141 | 154 | 208 | 277 | 403 | @@ -171,7 +171,7 @@ Medians; % columns are of aiortc's. How: [README](README.md#method). | Library | Last good | Stopped by | RSS at the last step (MB) | Setup p95 at the last step (ms) | | --- | --- | --- | --- | --- | -| wrtc 0.0.3 | 1450 | setup failed: wrtc: no dc_open in 15.0 s | 1156 | 417.0 | +| wrtc 0.1.0 | 1450 | setup failed: wrtc: no dc_open in 15.0 s | 1156 | 417.0 | | aiortc 1.15.0 | 1100 | setup failed: aiortc: no dc_open in 15.0 s | 676 | 77.8 | | pion v4.2.23 | 300 | setup failed: pion: no dc_open in 15.0 s | 896 | 4251.7 | | libdatachannel 0.24.6 | 2000 | reached 2000 connections | 1546 | 221.0 | diff --git a/benchmarks/charts/datachannel-cpu.png b/benchmarks/charts/datachannel-cpu.png index acc5e70..422a977 100644 Binary files a/benchmarks/charts/datachannel-cpu.png and b/benchmarks/charts/datachannel-cpu.png differ diff --git a/benchmarks/charts/datachannel-rtt.png b/benchmarks/charts/datachannel-rtt.png index 7861c0b..c37eee4 100644 Binary files a/benchmarks/charts/datachannel-rtt.png and b/benchmarks/charts/datachannel-rtt.png differ diff --git a/benchmarks/charts/datachannel-throughput.png b/benchmarks/charts/datachannel-throughput.png index f2a5bc4..a41c7db 100644 Binary files a/benchmarks/charts/datachannel-throughput.png and b/benchmarks/charts/datachannel-throughput.png differ diff --git a/benchmarks/charts/media-audio.png b/benchmarks/charts/media-audio.png index 0bf3e58..9499d72 100644 Binary files a/benchmarks/charts/media-audio.png and b/benchmarks/charts/media-audio.png differ diff --git a/benchmarks/charts/media-video-call.png b/benchmarks/charts/media-video-call.png index 01d6e83..e42cde5 100644 Binary files a/benchmarks/charts/media-video-call.png and b/benchmarks/charts/media-video-call.png differ diff --git a/benchmarks/charts/media-video-latency.png b/benchmarks/charts/media-video-latency.png index 927881c..284878f 100644 Binary files a/benchmarks/charts/media-video-latency.png and b/benchmarks/charts/media-video-latency.png differ diff --git a/benchmarks/charts/media-video-receive.png b/benchmarks/charts/media-video-receive.png index b4bedcc..2ed8e4f 100644 Binary files a/benchmarks/charts/media-video-receive.png and b/benchmarks/charts/media-video-receive.png differ diff --git a/benchmarks/charts/media-video-send.png b/benchmarks/charts/media-video-send.png index 810e231..f47d0ca 100644 Binary files a/benchmarks/charts/media-video-send.png and b/benchmarks/charts/media-video-send.png differ diff --git a/benchmarks/charts/memory.png b/benchmarks/charts/memory.png index 0f2097d..7e3e267 100644 Binary files a/benchmarks/charts/memory.png and b/benchmarks/charts/memory.png differ diff --git a/benchmarks/charts/setup.png b/benchmarks/charts/setup.png index 537b791..cee9455 100644 Binary files a/benchmarks/charts/setup.png and b/benchmarks/charts/setup.png differ diff --git a/docs/source/benchmarks.md b/docs/source/benchmarks.md index 4dd70f8..2769a29 100644 --- a/docs/source/benchmarks.md +++ b/docs/source/benchmarks.md @@ -23,7 +23,7 @@ processes, and the charts show the medians of each library's newest run. Against aiortc, Python WebRTC: - opens a connection **7โ€“8x faster**; -- moves **4.4โ€“9x more data** through a data channel, with **4โ€“6x less CPU** per megabyte; +- moves **7.7โ€“14.6x more data** through a data channel, with **7โ€“10x less CPU** per megabyte; - spends **less CPU on audio** at every stream count, up to 4x less when sending; - encodes H.264 in hardware on macOS, at **a tenth of the CPU** per frame; - delivers call video with **about half the latency**; diff --git a/docs/source/guides/aiortc.md b/docs/source/guides/aiortc.md index f133753..18321e5 100644 --- a/docs/source/guides/aiortc.md +++ b/docs/source/guides/aiortc.md @@ -75,7 +75,7 @@ Behaves differently: ## Performance -Python WebRTC opens connections 7โ€“8x faster than aiortc, moves 4.4โ€“9x more data through a data channel and spends +Python WebRTC opens connections 7โ€“8x faster than aiortc, moves 7.7โ€“14.6x more data through a data channel and spends less CPU on audio. See the [benchmarks](../benchmarks.md). The layer gives up some of that for compatibility: it costs up to 8% more than the same code on the native API. Each diff --git a/docs/source/index.md b/docs/source/index.md index b952a97..e4afb57 100644 --- a/docs/source/index.md +++ b/docs/source/index.md @@ -109,8 +109,8 @@ Prebuilt wheels for Linux, macOS and Windows, including free-threaded Python. No | VP9 and AV1 | โœ… | โŒ | โœ… | โœ… | | `pip install` on Linux, macOS and Windows | โœ… | โœ… | โœ… | โŒ system packages | -Against aiortc, it opens connections 7โ€“8x faster, moves 4.4โ€“9x more data through a data channel and spends less CPU on -audio. See the [benchmarks](benchmarks.md), which also measure Pion, libdatachannel and webrtc-rs. +Against aiortc, it opens connections 7โ€“8x faster, moves 7.7โ€“14.6x more data through a data channel and spends less +CPU on audio. See the [benchmarks](benchmarks.md), which also measure Pion, libdatachannel and webrtc-rs. ## Where to start diff --git a/pyproject.toml b/pyproject.toml index 80a9cac..6d2704d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "wrtc" # "webrtc" isn't allowed on PyPI -version = "0.0.3" +version = "0.1.0" description = "Chrome's WebRTC engine (libwebrtc M152), with the browser API, in Python" readme = "README.md" license = "BSD-3-Clause" @@ -14,7 +14,7 @@ requires-python = ">=3.9" keywords = ["webrtc", "libwebrtc", "rtc", "peer-to-peer", "data-channel", "video", "audio", "voip", "asyncio", "w3c"] dependencies = ["typing_extensions>=4.10"] classifiers = [ - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "Natural Language :: English", "Intended Audience :: Developers", "Framework :: AsyncIO", diff --git a/uv.lock b/uv.lock index 821527d..ac0e0be 100644 --- a/uv.lock +++ b/uv.lock @@ -4559,7 +4559,7 @@ wheels = [ [[package]] name = "wrtc" -version = "0.0.3" +version = "0.1.0" source = { editable = "." } dependencies = [ { name = "typing-extensions" },