Commit 2bcb8e7
committed
perf: faster Ogg page-magic scan in Broadcast; widen mirrorTranscodeMetadata tick to 5s
Broadcast(): the OggS page-boundary scanner was inspecting every byte
in the data slice one-by-one even though the magic only ever starts
where data[i] == 'O'. Skip ahead with bytes.IndexByte('O') between
candidates — for a 4-8 KiB Broadcast call with few O bytes (the
common case for Opus payloads) that is roughly 16x fewer comparisons.
mirrorTranscodeMetadata: bumped the polling tick from 2 s to 5 s.
Metadata changes per-track i.e. every few minutes; catching it 2 s
earlier vs 5 s is invisible to listeners and the YP directory, and a
2.5x slower tick removes RLock acquisitions on each input stream.1 parent 6d6364b commit 2bcb8e7
2 files changed
Lines changed: 25 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
444 | | - | |
445 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
446 | 452 | | |
447 | | - | |
448 | | - | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
449 | 461 | | |
450 | 462 | | |
451 | 463 | | |
452 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
453 | 468 | | |
454 | 469 | | |
455 | 470 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | | - | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
554 | 559 | | |
555 | 560 | | |
556 | 561 | | |
| |||
0 commit comments