Informix C++ API Performance
Posted in 2003
Topics: Performance & Tuning, Connectivity: ODBC / JDBC / .NET, Third-Party Tools & Monitoring
Hi - I suspect that Informix C++ client side programming API is an order of magnitude slower than ODBC calls as far as simple selects from database are concerned( The SQL is like "select distance from distance_table"). (Approximately) I do the following in C++.This while loop is executed million times - ITCursor cursor(_consDBConnection.GetConnection()); cursor.Prepare( LOAD_SQL ); cursor.Open(ITCursor::ReadOnly) while( row = cursor.NextRow() ) { int colIndex = 0; ITValue* ITV_dist = row->Column(colIndex++); // distance Lfloat distance ; ITConversions *c; if (value->IsNull() == false) { if (value->QueryInterface(ITConversionsIID, (void **) &c) == IT_QUERYINTERFACE_SUCCESS) { c->ConvertTo(retVal); } c->Release(); } // Create an object from the data read /* ... */ ITV_dist->Release(); row->Release(); }// while( row = cursor.NextRow() ) The code for doing the same thing in ODBC is much faster. 1) Is it true that Informix C++ API has performance problems wrt ODBC ? 2) Am I using the C++ API in the right way ? Thanks a lot nitin
FYI - we did some performance tests between ODBC and OLEDB using the Informix SDK v2.81 and found that the ODBC drivers were 20-30% faster at retrieving our data than the OLEDB provider. -- William Fields MCSD - Microsoft Visual FoxPro MCP - Win2k Pro US Bankruptcy Court Phoenix, AZ "While the complexity of this project is several orders of magnitude less than modeling heat flux in a fossil-fuel fired electric utility plant using the Hottel Zone technique, the context of each project evolves in a remarkably similar fashion." - Author Unknown "Nitin Rajput" <nrajput@manh.com> wrote in message news:7bef655f.0310160905.6c8e3149@posting.google.com... > Hi - > I suspect that Informix C++ client side programming API is an > order of magnitude slower than ODBC calls as far as simple selects > from database are concerned( The SQL is like "select distance from > distance_table"). (Approximately) I do the following in C++.This > while loop is executed million times - > ITCursor cursor(_consDBConnection.GetConnection()); > cursor.Prepare( LOAD_SQL ); > cursor.Open(ITCursor::ReadOnly) > while( row = cursor.NextRow() ) > { > int colIndex = 0; > ITValue* ITV_dist = row->Column(colIndex++); // distance > Lfloat distance ; > ITConversions *c; > if (value->IsNull() == false) > { > if (value->QueryInterface(ITConversionsIID, (void **) &c) == > IT_QUERYINTERFACE_SUCCESS) > { > c->ConvertTo(retVal); > } > c->Release(); > } > > // Create an object from the data read > /* ... > */ > > ITV_dist->Release(); > row->Release(); > }// while( row = cursor.NextRow() ) > > The code for doing the same thing in ODBC is much faster. > > 1) Is it true that Informix C++ API has performance problems wrt ODBC > ? > 2) Am I using the C++ API in the right way ? > > Thanks a lot > nitin