Socket Help

Bob Sneidar bobsneidar at iotecdigital.com
Mon Apr 6 14:52:06 EDT 2020


Hi Richard. 

Just to be absolutely certain I excluded any other factors, I tested retrieving data from mySQL from a Mac and from a PC using only the Message Box (no UI). 

Since I am out of the office, I can only test my Mac remotely. I can however remote into the mySQL server at work which is running LC. Both are v9.5.1 Community. 

With the Mac I am getting as low as 295 milliseconds to query my entire database of customers and retrieve it as an array. On the actual server where the mySQL database resides, I am getting over 1000 milliseconds. 

Querying for only 1 record from the same database, I’m getting 123 and 865 respectively. To ensure I wasn’t encountering DNS lag I set the server host to localhost. I cannot get much more local than that. 

Even with the added latency of the Internet from the Mac, and the advantage of the PC being the very computer the SQL server is on, I am getting a difference of roughly 7 times slower. No UI updating is involved. It’s a straight up message box script:

put the milliseconds into tStart
put sqlquery_createObject("customers") into qObject
sqlquery_set qObject, "limit", 1
put dbQuery(qObject, "array") into aData
put the milliseconds into tEnd
put tEnd - tStart

I think this is pretty conclusive. Either Windows networking is for whatever reason, considerably slower, at least for this kind of operation, than Mac, or else the Windows LC engine is the bottleneck. 

Bob S



More information about the use-livecode mailing list