Re: ADO record update



I'm having a performance problem with the following line of code:

TESTHR(m_adoBindPtr->Update(m_pAccountDataTable));

It's in a loop that runs in a fraction of a second without it and runs in
30
seconds with it included. The loop executes this line about 3000 times.
The
only field changed is a text field of 20 character max. The loop includes
the
binding of a new record on each pass...

Why?
I bind records once and then reuse the same struct/class over and over
again.
Seems nonsensical to keep binding on per-loop-iteration.

...and interogates 2 of the fields.

Below are some selected lines from other areas of the code to help
identify
the base classes etc. :

IADORecordBindingPtr m_adoBindPtr;
inline void TESTHR(HRESULT _hr) { if FAILED(_hr)
_com_issue_error(_hr); }
class CAccountDataBindingADO : public CADORecordBinding

Doesnt mean anything. You might have we as said

int i;
:
:
for (; ; ++i) // <= this increment is slow, why?

I suggest you give a _COMPLETE_ compileable example that is slow and then
there is something to examine.
Merely mentioning a few lines of your code is not enough to narrow things
down.
(and I tend to think that those programmers who display just 2 lines of code
almost like fish entrails and have the incredible expectations that you will
be able to diagnose _EXACTLY_ what is wrong from just those 2 lines - well
they cant be the sharpest knife in the drawer).

Any ideas why the "Update" method takes so long to execute???

No. You have probably done something incorrect but it will be the code you
dont mention.

Cheers

Stephen Howe


.



Relevant Pages

  • Re: The Lisp CPU
    ... If profiling shows there's a tight loop ... Because you're using dynamic binding, ... and re-bind them all with the most-crucial ...
    (comp.lang.lisp)
  • Re: DataTable Processing
    ... talking about binding, XML, or other things above and beyond what I ... > Use the DataTable.Select method to return an array of DataRows. ... > can loop through the array. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Feature request: subclassing FunctionType [Was: Some languageproposals]
    ... > with Haskell bindings rules, ... is there enough code relying on the loop ... for item in seq: ... It makes more sense to delete the binding automatically ...
    (comp.lang.python)
  • Re: Can I manually add items to a repeater after binding it?
    ... .NewRows as needed to fill in the holes before binding. ... LIfe will be easier if you loop from the bottom to the top, since you won't need to worry about jumping over the new rows as you insert them. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: assignment in a for loop
    ... what looks like "assignment" really is binding a name to an ... The result is that inside the loop I am creating an object ... You can also do it more succinctly with a list comprehension ...
    (comp.lang.python)