Thursday, March 29, 2012

Performance Q..

My development environments are ASP.Net and VB.Net and .NetFramework1.1.

I remember reading "using less number of session variables is good for
application performance".

Now instead of using 20 session variables, I can use one session variable
which carries the data for all the 20 variables that I want to keep track.

Is it a good idea? Any documentation on how exactly the sessions variables
are processed and stored in IIS5?

Thanks,

Lalit SinghPerformance generally falls into 2 categories: Processor and Memory.
Anything which saves Processor usage or Memory usage improves performance.
If you can remember that, you can stop relying on opinions you read to
determine what you should do.

Session is memory. Anything which reduces Session size will improve
performance. Combining Session variables into a single object isn't likely
to improve performance, as you aren't changing the size of anything, just
how it is stored. If I put 5 apples in a box, I still have 5 apples. I also
have the box now.

Programming instructions are Processor. If, by putting all of these objects
into a single object enables you to write leaner code, you will improve
performance. For example, using the apples again, taking the apples out of
Session one at a time, I need to write 5 sets of instructions, or a loop
that executes 5 times. If I take the box out, I use only 1 instruction. Of
course, at some point you're going to need to take the apples out of the
box. So, that kind of cancels out the savings there.

But let me get back to my original point: Don't rely on opinions. If you're
really concerned about performance, keep your eye on Memory usage and
Processor usage. Don't concentrate on Session. Concentrate on your whole
app. Look for opportunites to write leaner code, and maximize memory usage.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"Lalit Singh" <LalitSingh_34@.hotmail.com> wrote in message
news:#HlYRKg3EHA.3616@.TK2MSFTNGP09.phx.gbl...
> My development environments are ASP.Net and VB.Net and .NetFramework1.1.
> I remember reading "using less number of session variables is good for
> application performance".
> Now instead of using 20 session variables, I can use one session variable
> which carries the data for all the 20 variables that I want to keep track.
> Is it a good idea? Any documentation on how exactly the sessions variables
> are processed and stored in IIS5?
> Thanks,
> Lalit Singh
Thanks,
I was waiting to post during this hour of the day so that you will respond.
Thanks,
Lalit

"Kevin Spencer" <kspencer@.takempis.com> wrote in message
news:#X6bD6g3EHA.3708@.TK2MSFTNGP14.phx.gbl...
> Performance generally falls into 2 categories: Processor and Memory.
> Anything which saves Processor usage or Memory usage improves performance.
> If you can remember that, you can stop relying on opinions you read to
> determine what you should do.
> Session is memory. Anything which reduces Session size will improve
> performance. Combining Session variables into a single object isn't likely
> to improve performance, as you aren't changing the size of anything, just
> how it is stored. If I put 5 apples in a box, I still have 5 apples. I
also
> have the box now.
> Programming instructions are Processor. If, by putting all of these
objects
> into a single object enables you to write leaner code, you will improve
> performance. For example, using the apples again, taking the apples out of
> Session one at a time, I need to write 5 sets of instructions, or a loop
> that executes 5 times. If I take the box out, I use only 1 instruction. Of
> course, at some point you're going to need to take the apples out of the
> box. So, that kind of cancels out the savings there.
> But let me get back to my original point: Don't rely on opinions. If
you're
> really concerned about performance, keep your eye on Memory usage and
> Processor usage. Don't concentrate on Session. Concentrate on your whole
> app. Look for opportunites to write leaner code, and maximize memory
usage.
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Neither a follower
> nor a lender be.
> "Lalit Singh" <LalitSingh_34@.hotmail.com> wrote in message
> news:#HlYRKg3EHA.3616@.TK2MSFTNGP09.phx.gbl...
> > My development environments are ASP.Net and VB.Net and .NetFramework1.1.
> > I remember reading "using less number of session variables is good for
> > application performance".
> > Now instead of using 20 session variables, I can use one session
variable
> > which carries the data for all the 20 variables that I want to keep
track.
> > Is it a good idea? Any documentation on how exactly the sessions
variables
> > are processed and stored in IIS5?
> > Thanks,
> > Lalit Singh

0 comments:

Post a Comment