4 ms·
Can you comment on any performance hotspots due to Python (are there any)? What wouldn't this library be suitable for?
by Dowwie 8y ago
Can you comment on any performance hotspots due to Python (are there any)? What wouldn't this library be suitable for?
- jlaine 8y agoSo far the main CPU hog is (unsurprisingly) media encoding, especially video. Luckily this occurs off the main thread, inside C function calls. Unless I'm mistaken the GIL is released, so there is no Python-specific downside on this specific point. I've found heavy usage of asyncio.Queue to bridge consumers / producers does not lead to amazing performance, so I'm trying to cut down on that pattern in favour of.. callbacks (I know - not very asyncio-ish). A good testcase for testing performance without media encoding is transferring large amounts of data over datachannels (see datachannel-filexfer example). I usually hit ~ 70Mbps on the loopback interface, which is more than I've managed to get out of browsers. I can't say I have experience with using aiortc at scale yet, so there are almost certainly so hotspots I haven't seen.