Why does this code go so slowly?

Blitz3D Forums/Blitz3D Programming/Why does this code go so slowly?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I just edited with a new observation.

Also, when my client is running, the overall RottNet update on the server starts taking up to 4000 milliseconds! Something is badly wrong here. The client itself runs at 250 FPS no problem.

EDIT: I think it must be something to do with BlitzPlus being too nice about CPU time. (The server is B+, client B3D.) I noticed the client uses 98% CPU, and the server uses 0-2%.
Also it runs a lot faster with debug off - perhaps it was doing bounds checking on that Blitz array when debug was on? That might explain some of the slowness.