Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fastest way to access global vars

1 view
Skip to first unread message

rgh...@unionbankph.com

unread,
Feb 28, 2004, 10:43:47 PM2/28/04
to
fastest way to access global vars

hi guys,
I need your help on this.....
which is the fastest way to access global vars? (performance-wise)

#1. Applcation State

#2. <appSettings>

#3. Static public variable (global.asax)

(are there any other means?)

Thanks,

Alvin Bruney [MVP]

unread,
Feb 29, 2004, 12:40:08 AM2/29/04
to
> #1. Applcation State
This requires a cast out of an object variable

> #2. <appSettings>
This is a disk read

> #3. Static public variable (global.asax)

straight read.

You aren't looking at much difference here so that it would matter. What are
you trying to accomplish.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
<rgh...@unionbankph.com> wrote in message
news:40415fbf...@news.microsoft.com...

Michael Giagnocavo [MVP]

unread,
Mar 1, 2004, 8:12:35 PM3/1/04
to
combine #2 and #3:
public static readonly int MyInt = int.Parse(AppSettings["MyKey"]);

-mike
MVP

<rgh...@unionbankph.com> wrote in message
news:40415fbf...@news.microsoft.com...

rghatol

unread,
Mar 5, 2004, 2:36:09 AM3/5/04
to

I may be doing enhancement on an existing site wherein I need to do some checking on all pages (yes, kind of the old way of doing things in ASP) so, I need a faster/more efficient way of reading these data.

btw, on #2 as I understand it, appsettings will not be considered as a disk read (unless it's read for the 1st time) because it is cached.


rgh...@unionbankph.com

unread,
Mar 5, 2004, 1:13:54 PM3/5/04
to
sorry about that last post. i did that on micorsoft's web-based
newsgroup site.
0 new messages