Re:How much speed gain?
yes, i hope the bottlenet was the OOP part. however, the C++ do need to
execute more instructions. It seems the profiler is not included in the
standard version of VS 2005? And it sounds harder since I must configure VS
to launch SQL Server first.
(for each row)
vector.push_back: 200 times
dynamic_cast: 100 - 200 times
virtual method calls several hundred times
(I guess template should have little runtime speed issues.)
So a pure C code can remove several million of these intructions. Anyone can
give a rough number of executive time? (Consider SQL Server need to open a
cursor and read and write rows)
I will write a xslt code to automatic generate the "dumb" C code if it takes
a more than 20% of total execution time....
"Carl Daniel [VC++ MVP]" wrote:
Quote
nick wrote:
>I am developing a sql server extended stored procedure. The
>developing tools are VS 2005 standard, SQL Server 2005 The stored
>procedure will used in a database cursor loop iterating from several
>million to 20 million.
>
>I used std::vector to store the parameter class pointers (about 200).
>And I used virtual method. (Base class are abstract class), template
>sub classes, dynamic_cast, static_cast....
>
>The 7M rows takes about five hours. How much speed gain if I use
>simple C code to implement it?
Most likely, little or none at all, because most likely, code execution
speed is not your bottleneck. Do some profiling to find out where you're
spending the time before guessing at fixes.
-cd
-