AllowDBNull & Performance?

  • Thread starter Thread starter Geert-Jan
  • Start date Start date
G

Geert-Jan

Hi,

We have a C# programm running on .NET 1.1
I have found that on some PC's the performance decreases when using
AllowDBNull=false on a DataColumn. By looping extensively through many
DataRows in the DataTables, this becomes evident: the application is
twice as fast without those codelines.
Strangely, on other systems I detect no differences.
Has anyone else seen this behaviour, or, even better, an explanation?

Thanks

Geert-Jan
 
For updates, I could understand that .NET have a bit more work to do to
check for this constraint when enabled.

Also relative comparison should be taken with care especially if you have
only that in your loop. It will be two times longer to do two math
operations than one but if the the change is that you go from 0,2 s to 0,4 s
this is likely not this loop that is the problem. What is the absolute
change ? For which number of rows ?

Perhaps also a paging issue ?
 
Hello Miha,


It is not the looping that is the cause, as it's the same amount of
actions performed.
We use mainly DataTable.Select to find rows, no updates.
And, as mentioned before, it is not slower on all computers, but on
some DataTable methods are much slower when AllowDBNull=true

//get all successors

sfilter = String.Format(usCulture, "Loknummer='" +
tiRow["Locnumber"] + "' AND " + locGanttDepartureString
+ " >= #{0:g}# ", tiRow[locGanttArrivalString]);
rows = table.Select(sfilter, locGanttDepartureString);


Geert-Jan Gorter
proLOGiT Office & Logistics Software Development
Dortmund / Gemany
Can you show us some code that shows your loop?

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Geert-Jan said:
Hi,

We have a C# programm running on .NET 1.1
I have found that on some PC's the performance decreases when using
AllowDBNull=false on a DataColumn. By looping extensively through many
DataRows in the DataTables, this becomes evident: the application is
twice as fast without those codelines.
Strangely, on other systems I detect no differences.
Has anyone else seen this behaviour, or, even better, an explanation?

Thanks

Geert-Jan
 
Back
Top