|
Does anyone have any idea why C++ program is significantly slower than
C program?
Explain the situation.
I have a number of APIs that are called via RPC, access some tables,
make some calculations and return some structures to the caller.
They've all been written on ILE/C.
Recently I started to experiment with porting them to ILE/C++.
<<SNIP>>
What I saw is that time increase looks like it has a proportional
nature. I tested API in 3 cases (number of tests is over 100):
simple request, medium request; complicated request
and the timing is:
• Simple C: 1ms; Simple C++ : 2ms
• Medium C: 3ms; Simple C++ : 7ms
• Long C: 25ms; Long C++: 60ms.
The difference is in number of records read from table and a number
of calculations. That is, a
• simple one retrieves less that 10 records;
• medium - more than 10 and
• long - more than 100. Program makes a lot of calculations
with packed decimal.
Any idea why it is like that
and is there anything that can be done about it?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.