Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload speed improvements #72

Open
mint-dewit opened this issue Jan 10, 2020 · 2 comments
Open

Upload speed improvements #72

mint-dewit opened this issue Jan 10, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@mint-dewit
Copy link
Contributor

Currently the media uploading in this library is significantly slower than the atem software. There appear to be a couple of factors that could be improved in the library in that regard.

Max packets per tick constant

The amount of packets sent per tick are limited by this constant https://github.com/nrkno/tv-automation-atem-connection/blob/master/src/dataTransfer/index.ts#L10

Doing some testing under node 8 with the strict-config branch reveals that setting this property to 40 can reduce upload speeds from ~1800ms to ~1400ms. Setting it higher (80) gives little benefit and setting it too high (160) gave many packet resends. Possibly this value should not be constant but instead be variable based on how many packets are resent.

Multithreading overhead

Disabling multi threading in the strict-config branch gives me another 300-400ms benefit. Combining this with the aforementioned max packets constant optimization I can reach sub second transfers, which is an almost 2x improvement

RLE encoding

The atem software applies RLE encoding as an optimization. I don't know how much faster that would make our transfers but it would optimize things where a lot of black is included such as lower thirds and logo bugs.

@mint-dewit mint-dewit added the enhancement New feature or request label Jan 10, 2020
@Julusian
Copy link
Member

Shared Memory (Multithreading overhead)

We can probably get some improvements by using SharedArrayBuffer or ArrayBuffer instead of using Buffer over the ipc bridge, as the buffers get converted to arrays of numbers that we have to convert back to a Buffer. Some work may be needed in threadedClass to handle these types.
This will reduce the noted overhead of multithreading

@Julusian
Copy link
Member

Max packets per tick is changed and RLE is implemented by #149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants