on 2011 Nov 14 12:18 PM
In 11.0.1.2550 I have made the observation that SAConnection is slower than OdbcConnection for simple operations going through tcp/ip like:
OdbcConnection myConnection = new OdbcConnection("dsn=xxx"); myConnection.Open(); OdbcCommand myCommand = myConnection.CreateCommand(); myCommand.CommandText = "SELECT 1"; myCommand.ExecuteScalar(); myCommand.Dispose();
With Odbc it needs ~310 ms and uses 29 TCP/IP packets,
with SA it needs ~350 ms and uses 48 TCP/IP packets
Have there been any performance improvements regarding this situation in current versions of the iAnywhere.Data.SQLAnywhere?
Request clarification before answering.
I can think of two improvements that have been made to version 12 that may help.
One is a round trip during the connect sequence has been eliminated for both ODBC and ADO.Net.
The second is connection pooling is enabled by default. In order for connection pooling to be helpful, the same process must connect at least 5 times with the exact same connection string, disconnect and connect again with the same connection string.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer, the exact same connection string is in my opinion not a good choice, as the connection string by default includes the AppInfo which contains even the thread id, so the connection needs to be issued by the same thread otherwise no use for pooling. Or is the relevant connection string just the program provided data?
The generated portion of the AppInfo string is ignored when determining if two connection strings are the same for connection pooling. If a user specified AppInfo parameter is specified, that is included in the comparison.
@Martin: Based on that important (and senseful) detail, I've felt free to edit that answer 🙂
User | Count |
---|---|
82 | |
29 | |
9 | |
8 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.