Optimizations for parsing and receiving OSC messages from recv.#259
Optimizations for parsing and receiving OSC messages from recv.#259
Conversation
|
I have an idea on how to reduce as much overhead on OSC parameter parsing as possible:
Not sure how much this would help but it would drastically reduce the amount of processing that needs to be done on the redundant parameters, and avoiding extra marshalling on OscValue and type parsing. |
benaclejames
left a comment
There was a problem hiding this comment.
I'm all for improving on the osc stuff yea! I think some work defo needs to be done in fti but I'd love to hear what you think in terms of what needs improving.
|
|
||
| private Socket _recvSocket; | ||
| private readonly byte[] _recvBuffer = new byte[4096]; | ||
| private readonly byte[] _recvBuffer = new byte[64]; |
There was a problem hiding this comment.
Just curious as to why this was changed to 64
There was a problem hiding this comment.
I found that received messages never exceeded 64 bytes from VRChat but OSC never standardized a message size limit so having the buffer be as big as possible would be safer. This would also be a VRChat OSC specific optimization too.
Simple as it sounds. There are a few more optimizations that I want to explore but these already give a huge performance bump!
Some points:
/avatar/parameters/*from being sent over? We don't really need to track face tracking parameters outside of the toggles. This would drastically avoid redundant receives and parsing of OSC messages. Fun fact but nearly 90% of the use of RecvService is parsing redundant messages from VRChat!I guess it's just typical VRChat OSC jank 😅.