Closed almgong closed 7 years ago
One way: Circular arrays
Coupled circular array
I like this option the best due to its simplicity (and avoidance of any parallel data structures).
Some skeleton outline for coupled circular array:
loop indefinitely:
Daisy chaining is actually FASTER with my device, as my device(s) are weaker...
However I think it may be an issue wherein the overhead of creating async tasks overwhelm the benefits of parallelism. We should implement a thread (or a service) that does this...
Implementation of above at: b7d9e57
On second thought, it is very difficult for window to work in a single thread (because we need to sleep in between processEvents() calls (it would kill performance otherwise)... And this alone would defeat the purpose...
So for now, implementing for daisy chaining for benchmarking purposes.
No benefit from using another thread -- avgs 500ms perpacket regardless...
For now, we cannot proceed further on #14 because of the network and device limitation... Best approximation is simply being able to buffer media from multiple devices, and therefore waiting on your own end to watch a video.
This being said, we can still implement seek on consumer end, which will update the seq num appropriately.
Just tried reducing the processEvents timer to ~100ms each, speed improved drastically.
Daisy chaining is a fine method.
The ratio of getFromBuffer and addToBuffer is far too large - we should instead have a tcp window-like implementation that allows you to have x standing interests tasks running in parallel, that pieces together the data before putting into the buffer
[x][x][ ][x] should wait for the 3rd element -> once it comes add all 4 in succession, etc.