473,383 Members | 1,792 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,383 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 1952
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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

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.