"Ryan Taylor" <
rtaylor@stgeorgeconsulting.com>wrote in
Quote
Hello
We are about to dive into a new application for a client. This
application is going to have database reads from multiple tables
(probably just one sql query) every 500ms or less. Once I get my
results back, I need to perform some action with those results,
the quicker I get my results back, the quicker I can peform my
action. The database is MSDE and is going to reside on the local
machine.
I was wondering if anyone had any information on performance
between C++ and C#, specifically regarding database reads.
Generally I have used C# and ADO.NET for database driven
applications, but performance is a real concern here, and can be a
deal breaker between C++ and C#. Please try to be as objective as
possible.
Also what technology is reccommended for connecting to an MSDE
database via C++. ADO?
The answer really depends on what query you're running and what are
the actions you need to perform. If your query is not some kind of
data-mining, 2 queries per second is about idle mode for most
database engines. It is very likely that the database can provide you
results in a couple of ms or something like that (except the first
time you run the query). Of course, that really depends on the query,
but it's typical for the queries people use as a poll.
Add to this time the time spent in various database layers you use
(ODBC, Ole DB, ADO etc). This overhead generally varies from
combination of the client technology and the database provider. If
you're looking for ultimate performance, you can use database
specific libraries, like Open Client for Sybase or MySQL client
library for MySQL. I don't know what's the best for MSDE though.
These consideration mostly apply to the systems with 100 of
transactions per second, so it is not likely to make much difference
in your case.
This will only leave your own code to consider and that's the only
place where your choice of the language makes difference. C++ and C#
will give identical results as long as you don't use managed
extensions, otherwise you can theoretically make faster code in C++,
but in practice, the difference you gain won't usually worth the
effort. So my advise is probably to choose whatever language you're
more comfortable with and concentrate on your algorithm.
Alex.
-