How to speed Up Add_Vector command?

Customers who use the QIS server tool may experience delay of 1-3 seconds when using many calls of Add Vector command.

Reason for the problem

Sending just one Add_Vector in a socket send is instant because QIS simply stores the incoming socket data in a buffer. QIS keeps reading the socket until it's internal buffer (64K) is full, then it checks if there is anything else in the socket, and there are more commands, so QIS's internal buffer grows and does a reallocation. This reallocation is the process which takes a few seconds.

Solution

Try to accumulate many Add_Vector commands together in a buffer (e.g. a 64K bytes buffer), and then send these 64K bytes to QIS in one socket send.
This will minimize socket overhead between each socket send when only one Add_Vector command is sent for each socket send.
Since the internal maximum socket read size in QIS is 64K per read, with this method, QIS could be making just one low level system socket read call instead of thousands of system socket calls.

Alternatively, try 4K, 16K, 64K and see if it makes a difference for you.
After sending each 64K chunk to QIS, wait a bit before sending another chunk in order to let QIS to process the data before QIS starts to read the socket again. Otherwise, QIS would keep reading the socket and reallocating it's internal buffer.
If you have the Add_Vector return handle turned on (Set_Add_Vector_Handle), you can wait until you get all the handles.
If you have the return handle turned off, we suggest a trial and error experiment to figure out how long to wait.