Spaces:
Running
Running
Z Agent commited on
Commit ·
f9e41f8
1
Parent(s): 4a90d00
booster: 6 parallel ranges (measured: parallel connections keep ~430KB/s each)
Browse files303 unmodified lines304305306307307308309310311311312313314315316317318319303 unmodified lines return h
async def _boosted_segment(u: str, headers: dict, total: int, parts: int = 4):async def _boosted_segment(u: str, headers: dict, total: int, parts: int = 6): """Fetch a binary segment as `parts` parallel HTTP Range requests and reassemble. Returns the full bytes on success, or None on ANY problem (caller falls back to the normal single-stream path). Segments are bounded (a few MB), so buffering the reassembled body is fine.""" bounded (a few MB), so buffering the reassembled body is fine.
parts=6: measured per-connection throttle is ~450KB/s and parallel connections keep most of their individual rate (3 concurrent ≈ 433KB/s each), so 6 parts ≈ 2.2MB/s aggregate — a 10s/5MB segment lands in ~2-3s instead of 11s, comfortably inside hls.js's fragment budget.""" step = total // parts if step < 256 * 1024: return Nonemain.py+7-2