Re: Need More ADO Suggestions

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Cowboy,

Let's take the DataReader. You end up with a couple of choices.

1. You keep the connection open until you use the reader (expensive)
2. You pack the reader into objects or something else

I would shy away from #1, as it will ultimately kill you. If you do #2, you lose performance. The question is: Whose algorithm is faster, yours or Microsoft's? Can you pack objects quicker than a DataSet? If so, you may have more performant code, but you do so at the cost of a loss of maintainability. Is it worth it? It depends on the application.

Your point is well taken and I'm incorporating that into my thinking. Note that it's not that my algorithm is quicker than Microsoft's. Rather, my algorithm might not need all the functionality that Microsoft's more generic DataSet algorithm might employ. But, again, that's another dimension for me to consider.

In general, I find maintainability costs companies far more than performance. If I err, I will generally err on the side of maintainability. Now, there are times you need to focus on performanc up front, but I find it more common that you can find out if the application is below the bar using testing tools. If so, you are fine and there is no need to squeeze out a cycle or two. If not, you focus on the inner loop or other bits that are called over and over again in "normal" application use.

Well, before I used C++, I used C. And before that, I used assembler. Obviously, we all have different levels at where we are comfortable developing software. But, here, I think things are a little different because a successful site has the potential to slow down due to heavy usage. So, for a Website, I think performance might just be more important than ever before even when it doesn't seem to matter while under development. YMMV.

When you look at it, performance can be the enemy of scalability, maintainability and even security. Are you willing to throw all of these away for a few cycles? Possibly on some applications, but, in general, the answer is no.

I'm not interested in losing any of those. Hopefully, if I can understand the technology well enough, I won't have to.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

.



Relevant Pages

  • Re: Who is a Good Programmer?
    ... >>optimum for speed and maintainability, ... There is an implication here about the choice of algorithm. ... get a database and don't try to write the code ... Chuck that clean, ...
    (comp.programming)
  • Re: Finding a minimum of a function with two variables
    ... selecting the minimum. ... the reader. ... a better algorithm than the above. ...
    (comp.lang.fortran)
  • [rfc][patch 1/3] slub: fix small HWCACHE_ALIGN alignment
    ... SLUB should pack even small objects nicely into cachelines if that is what ... Use the same algorithm as SLAB for this. ...
    (Linux-Kernel)
  • Re: sr.ReadLine() problem
    ... could help you (to reset the reader to the beginning before the second ReadLine() call): ... I must admit that your algorithm isn't really clear to me - it might make a lot more sense to restructure it, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Commenting the source code.
    ... Randy Howard writes: ... >> If it isn't, the comments should describe the algorithm, not the code ... something the reader doesn't already know. ... Keith Thompson kst-u@mib.org ...
    (comp.lang.c)