OdbcCommand.Parameters.Add Slow Performance

Last post 11-07-2009 9:28 PM by anandhabbu. 4 replies.

Sort Posts:

  • OdbcCommand.Parameters.Add Slow Performance

    11-07-2009, 7:22 AM
    • Member
      1 point Member
    • codetale
    • Member since 09-30-2009, 2:56 PM
    • Posts 4

    I am encounter that OdbcCommand.Parameters.Add are perform quite slow

    i am not sure if this is common problem,
    or not a problem at all when in real deploy state.

    I loop for 200000 times, and it
    spend about 2200ms, add 4 parameters
    spend about 5000ms, add 10 parameters

    thank you very much

  • Re: OdbcCommand.Parameters.Add Slow Performance

    11-07-2009, 12:30 PM

    Perhaps the problem is the way you are testing it.


    Regards Mike
    [MVP - ASP/ASP.NET]
    My site    Please help - URGENT!!!    What ASP.NET can and can't do
  • Re: OdbcCommand.Parameters.Add Slow Performance

    11-07-2009, 9:04 PM
    • Member
      30 point Member
    • anandhabbu
    • Member since 06-15-2009, 10:58 PM
    • Posts 12

    I am not sure why you want to perform operations like looping for 200000 times. Can you provide more details? Are you inserting data or updating or selecting? Have you looked a using data set and perform your operations in batches? 

  • Re: OdbcCommand.Parameters.Add Slow Performance

    11-07-2009, 9:22 PM
    • Member
      1 point Member
    • codetale
    • Member since 09-30-2009, 2:56 PM
    • Posts 4

    actually i am create a helper class that help me do some data mapping, auto load/update when required
    but i felt that my helper class running slow, so i just test it and try to optimized it.
    and i found is the OdbcCommand.Parameters.Add slow down the process

    i know that not an issue in real running state, because it will not run 200000 time with in a short time
    just wonder why the OdbcCommand.Parameters.Add are slow
    i thought it just adding the Parameter object into the collection

    it worse when there many parameters

  • Re: OdbcCommand.Parameters.Add Slow Performance

    11-07-2009, 9:28 PM
    Answer
    • Member
      30 point Member
    • anandhabbu
    • Member since 06-15-2009, 10:58 PM
    • Posts 12

    I dont know if its documented anywhere that using parameters will slow down or not. But whenever you use a wrapper class it will slowdown performance may be by very small fraction, you might notice difference when the load is large like you mentioned in your case.

Page 1 of 1 (5 items)