Forum Discussion
Veeta
11 years agoVisitor
While I haven't timed any brightscript for my own applications, just a scan of your code would lead me to target a few things.
- Does udp.receive take a long time? How about receiving a large block (20*20=400) and looping over it so you only have to read from the network once
- Does object construction take a long time? Move 'params = {}' out of your loop and reuse it.
- Do you have to walk the player array for every update that comes in? Perhaps players should be an associative array where the key is 'id'. Then most likely you'll have C code in the brightscript interpreter finding the matching player for the update rather than having to walk an array and test the id for every entry.