[code]//----------------------------------------------------------------------
dim MyDB as new MySQLCommunityServer
dim Register as RecordSet
dim n as integer, TimeStart as integer, TimeEnd as integer
dim Milliseconds as integer
First of all, please excuse me my very bad english (I’m spanish).
John Hansen: The problem not is the recordset close. If you see the code, this is only for the know time it takes to open and close a recordset 1000 times.
Bob Keeney: The platform is Mac osx. In a Button.action in any web page. Not matter the place of code (this only run one time).
The problem is the platform where this code is executed. If you execute this code in a Desktop application, then the Recordset.SQLSELECT takes 0,89 milliseconds in execute, but if you run the same code in a WEB application, the recordset.SQLSECT takes 17 milliseconds. Many times this operation is very slow.
I made this tests:
REAL STUDIO 2012 Release 1: Desktop (Recordset.SQLSELECT) takes 0.89 milliseconds. WEB application (Recordset.SQLSELECT) takes 0.89 milliseconds.
I tried it. Yes, the web is slower.
That is because it runs on a thread, so it yields CPU time to other threads. For my test it spends 60% waiting.
The desktop runs query on main thread and does not yield.
We are using MySQL in a fairly large web app and we’ve not noticed any issues. Honestly, the latency of the internet is big enough where we haven’t seen any speed issues.
and I would like to add that if you are showing huge amount of results like 1000 records in a weblistbox with 5 or more columns in each row you should take into consideration that this data first must be transferred to the users’ web browser. Better work with LIMIT and scrollable Pages to keep your web app fluid.
[quote=55018:@Christian Schmitz]I tried it. Yes, the web is slower.
That is because it runs on a thread, so it yields CPU time to other threads. For my test it spends 60% waiting.[/quote]
is a lot.
it would be interesting to see if it’s as slow with SQLITE (closer communication with the app), and the MBS SQL plugin.
For Tomas I can suggest using a timer on the webpage. do the query, fill the table with 20 record and keep the recordset in a property. Than start a timer and in the timer add 20 more rows every 500 ms. This way your listbox loads smoothly.