{"action":"created","issue":{"url":"https://api.github.com/repos/brion/ogv.js/issues/444","repository_url":"https://api.github.com/repos/brion/ogv.js","labels_url":"https://api.github.com/repos/brion/ogv.js/issues/444/labels{/name}","comments_url":"https://api.github.com/repos/brion/ogv.js/issues/444/comments","events_url":"https://api.github.com/repos/brion/ogv.js/issues/444/events","html_url":"https://github.com/brion/ogv.js/issues/444","id":182631379,"number":444,"title":"Aim for 0-copy between StreamFile and demuxer","user":{"login":"brion","id":103075,"avatar_url":"https://avatars.githubusercontent.com/u/103075?v=3","gravatar_id":"","url":"https://api.github.com/users/brion","html_url":"https://github.com/brion","followers_url":"https://api.github.com/users/brion/followers","following_url":"https://api.github.com/users/brion/following{/other_user}","gists_url":"https://api.github.com/users/brion/gists{/gist_id}","starred_url":"https://api.github.com/users/brion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brion/subscriptions","organizations_url":"https://api.github.com/users/brion/orgs","repos_url":"https://api.github.com/users/brion/repos","events_url":"https://api.github.com/users/brion/events{/privacy}","received_events_url":"https://api.github.com/users/brion/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/brion/ogv.js/labels/performance","name":"performance","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-12T20:53:38Z","updated_at":"2016-10-12T22:28:46Z","closed_at":null,"body":"In the new StreamFile code there's an extra copy between the backing buffer and the demuxer, which increases memory usage and CPU time. Would be nice to expose the buffers more directly for more efficient reading, then only do the copy at the end. Look at the internals in the JS webm demuxer to confirm API suitability. :)"},"comment":{"url":"https://api.github.com/repos/brion/ogv.js/issues/comments/253358305","html_url":"https://github.com/brion/ogv.js/issues/444#issuecomment-253358305","issue_url":"https://api.github.com/repos/brion/ogv.js/issues/444","id":253358305,"user":{"login":"brion","id":103075,"avatar_url":"https://avatars.githubusercontent.com/u/103075?v=3","gravatar_id":"","url":"https://api.github.com/users/brion","html_url":"https://github.com/brion","followers_url":"https://api.github.com/users/brion/followers","following_url":"https://api.github.com/users/brion/following{/other_user}","gists_url":"https://api.github.com/users/brion/gists{/gist_id}","starred_url":"https://api.github.com/users/brion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brion/subscriptions","organizations_url":"https://api.github.com/users/brion/orgs","repos_url":"https://api.github.com/users/brion/repos","events_url":"https://api.github.com/users/brion/events{/privacy}","received_events_url":"https://api.github.com/users/brion/received_events","type":"User","site_admin":false},"created_at":"2016-10-12T22:28:46Z","updated_at":"2016-10-12T22:28:46Z","body":"Looking at https://github.com/FlareMediaPlayer/FlareWebmDemuxer/blob/master/src/DataInterface.js in more detail... yes this is making more sense to me now. :) We've ended up with overlap between DataInterface and StreamFile in that they both now manage buffers, so once the demuxer is given a StreamFile directly we can avoid pre-splitting the input buffers into chunks and re-assembling them inside the demuxer, instead reading directly from the StreamFile's internal buffers.\r\n\r\n(Internally it's still in chunks, but they may be differently sized depending on network conditions, caching, etc. Plus the StreamFile has a more advanced buffer management in terms of keeping old data so you can seek within buffered areas; avoiding exposing this logic to the demuxers should simplify writing more of them!)\r\n\r\nMight be best to expose byte-reading methods on the StreamFile interface; then the DataInterface doesn't have to manage its own buffers (instead using StreamFile's backing buffers), but can concentrate on pulling octets and doing the higher-level work like reading variable-length element ids and vints.\r\n\r\nWhen we get to the packet payload, it can be pulled as a single chunk, with the boundary-spanning copies done within StreamFile.\r\n\r\nTodo:\r\n* add readUint8(), readInt8(), etc methods on StreamFile\r\n* finish adapting the player logic to delegate the stream to the demuxer once opened\r\n* adapt the emscripten demuxer to handle input via stream\r\n* adapt the pure-JS demuxer to handle its input via stream\r\n"}}
{"actor":{"display_login":"brion"}}