We have an old DLL written with Visual C++, no MFC. The DLL construct a
fairly complex sql dynamically and send it to an Oracle 9 or 10 server.
We recently ported the code as a web service written in C# with .NET
1.1. We ran comparative performance statistics to ensure that our new
implementation would be as fast as the 10 years old, very mature and
very optimized version. Here are the results:
When the SQL is first send:
C++ : avg=655ms, std=1100ms
C# : avg=672ms, std=1146ms
When we repeat the same search again:
C++ : avg=178ms, std=166ms
C# : avg=78ms, std=66ms
Our conclusions are:
- when the sql if first send, a "context switch" seems to occur on
the server
- the time to process the SQL seems identical for both C# and C++
- if the SQL was already send on the current connection, the
performance is much faster
Question:
- why is .NET framework twice faster than C++ to "pump" back the data
of an already submitted SQL? The transport should be done by OCI
library using tcp/ip socket in both approach?
(Measurement was done in both case thru call of QueryPerformanceCounter
and ...Freq.