473,320 Members | 1,933 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,320 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 920
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...
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...
4
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...
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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...

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.