473,387 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Using reflection in an asp.net web page ... performance

Am I out of my mind if I use Reflection everytime someone logs into our site
to get and track the current Major/Minor/Build/Revision version that the
person is viewing our site through? This information would then be logged
to a database along with some other information about the user.

Thanks in advance.

Mark
Nov 18 '05 #1
2 1953
If you are only doing it once, in the sessionstart or something like
that, then you arent crazy, unless you site is getting hundreds of new
users per second.

IE, if you are running amazon.com, this is a bad idea. If you are
running some little dinky site, you are probably fine, as long as you
don't get /.ed

You do mean the version of your app right, not the version of their
browser? There is a much better way to get their browser info, and in
fact reflection won't work at all for that purpose.

I would think it would be easy to tell which version of your own app
you have running on the server. Do you have a large farm or something
where there might be multiple versions deployed?

"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message news:<#y**************@TK2MSFTNGP12.phx.gbl>...
Am I out of my mind if I use Reflection everytime someone logs into our site
to get and track the current Major/Minor/Build/Revision version that the
person is viewing our site through? This information would then be logged
to a database along with some other information about the user.

Thanks in advance.

Mark

Nov 18 '05 #2
Hi Jason,

I'm sorry, but you might exaggerating the case just a little here. First
while reflection is slow compared to direct access or invokation it's not
THAT slow. For example, compare Reflection to a COM object invokation and
call in class ASP and it's outright fast.

Second, even if you don't use Reflection in your code, I'm sure there are
lots of places in the ASP.Net internal code as well in the .Net framework
itself that uses reflection to discover values dynamically at runtime.

I ran a few very simple tests just to verify that I'M not completely off my
rocker here, and sure enough adding a couple of reflection calls to even an
empty ASPX page resulted in nearly identical performance results in ACT. The
general variance of ACT in short tests actually had the reflection test
ahead in 1 of the tests - all the others were also very close with close 250
requests a second against the sample page.

THere's no doubt that relfection is slower than direct access, but there's
not even enough to worry about for making one or two Reflection per request.
You should worry about this for tuning in framework code that gets called
repeatedly and in a loop, but for single calls it's hardly a concern.

Regards,

+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/weblog/
----------------------------------
Making waves on the Web
"Jason Coyne Gaijin42" <go*******************@sneakemail.com> wrote in
message news:98*************************@posting.google.co m...
If you are only doing it once, in the sessionstart or something like
that, then you arent crazy, unless you site is getting hundreds of new
users per second.

IE, if you are running amazon.com, this is a bad idea. If you are
running some little dinky site, you are probably fine, as long as you
don't get /.ed

You do mean the version of your app right, not the version of their
browser? There is a much better way to get their browser info, and in
fact reflection won't work at all for that purpose.

I would think it would be easy to tell which version of your own app
you have running on the server. Do you have a large farm or something
where there might be multiple versions deployed?

"Mark" <mf****@idonotlikespam.cce.umn.edu> wrote in message

news:<#y**************@TK2MSFTNGP12.phx.gbl>...
Am I out of my mind if I use Reflection everytime someone logs into our site to get and track the current Major/Minor/Build/Revision version that the
person is viewing our site through? This information would then be logged to a database along with some other information about the user.

Thanks in advance.

Mark

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Flare | last post by:
Hi. In extension to my former qustion about the command pattern (wich im still interested in) i´ve tried to implement the Servlet with reflection. My idea is, to create a new class wich inherit...
1
by: Taylor | last post by:
I was pleased to find this that I could easily access all the links in a page using this construct: IHTMLDocument2 d = (IHTMLDocument2) ie.Document; IHTMLElementCollection links = d.links; ...
2
by: Mark | last post by:
Am I out of my mind if I use Reflection everytime someone logs into our site to get and track the current Major/Minor/Build/Revision version that the person is viewing our site through? This...
6
by: Ken Varn | last post by:
I have an ASP.NET application that is calling a custom class that is trying to parse all of the members of my Page object using Type.GetMembers(). The problem that I am having is that private...
2
by: gabe | last post by:
We use a custom versioning scheme that includes the date and time (2.0.10271545). The version number is displayed in a footer user control, which is rendered in every page. The web application is...
4
by: .NET VB NewBEE | last post by:
hi after going thru some articles i'm confused with "How to implement Reflection in my program" my requirement is to dynamically load dll(whih got a specific Interface) files from the same...
5
by: Anders Borum | last post by:
Hello! Whilst refactoring an application, I was looking at optimizing a ModelFactory with generics. Unfortunately, the business objects created by the ModelFactory doesn't provide public...
4
by: Per Bolmstedt | last post by:
(This question has been asked previously in this group, but I don't think it was ever really properly answered.) I want to use reflection - preferably - to find all Web Forms in my web site that...
83
by: liketofindoutwhy | last post by:
I am learning more and more Prototype and Script.aculo.us and got the Bungee book... and wonder if I should get some books on jQuery (jQuery in Action, and Learning jQuery) and start learning about...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.