I have to agree with David here ..
The difference between calling a singleton and calling a static method is
trivial compared to an inefficient query (or even a missed packet :))
If you have a single query that takes 100 ms longer than "optimal" running
that query 10 times is equivalent to millions of these calls.
A more specific answer though is that the singleton will be marginally
slower than static methods (because you have to obtain the singleton). The
singleton is however also much mroe flexible as it can do things such as
implement an interface which static methods cannot.
Cheers,
Greg
[quoted text, click to view] "John A Grandy" <johnagrandy-at-yahoo-dot-com> wrote in message
news:eVCzOeXbGHA.4672@TK2MSFTNGP04.phx.gbl...
> I'm trying to determine the relative performance of three implementations
> of data-access classes in ASP.NET 2.0 :
>
> 1. non-singleton classes with non-static methods which must
> instantiate a class object (possibly multiple times) in each method
> involved in processing a page request
>
> 2. singleton classes that implement a getInstance() method that
> provides a pre-existing instance of the class if one exists; if an
> instance does not exist, getInstance() instantiates a class object and
> assigns it to an internal static reference
>
> 3. classes where all data-provision methods in the interface are
> implemented as static methods
>
>
> In the course of writing a scalable ASP.NET 2.0 web-app, has anyone done
> any benchmarking (either formal or informal) ... or has a general sense
> of the relative peformance of these 3 implementations ?
>
> Does anyone know of any whitepapers or other studies that might be
> available ( either MS or external ) ?
>
>
>
>
>
>
>
>