473,769 Members | 5,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2013
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****@idonotl ikespam.cce.umn .edu> wrote in message news:<#y******* *******@TK2MSFT NGP12.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************ *******@sneakem ail.com> wrote in
message news:98******** *************** **@posting.goog le.com...
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****@idonotl ikespam.cce.umn .edu> wrote in message

news:<#y******* *******@TK2MSFT NGP12.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
1419
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 from a abstract calss Action with the public method perform, for every new "operaiton" on my website. I then use reflection to load this class coresponding to a RequestParameter. I am interested in hearing what you gurus ;) think about this...
1
13339
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; but disappointed to find I couldn't do the same to get all my tables (using something like d.tables). Instead I'm resorting to the naive approach of iterating thru d.all casting to a table and picking out the objects that didn't turn to null.
2
935
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 information would then be logged to a database along with some other information about the user. Thanks in advance. Mark
6
4791
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 members are not returned. I did some digging and the MSDN documentation states that the caller must have ReflectionPermission in order to get the private members of a class. I am a little unfamiliar with this stipulation. I have checked the docs on...
2
1256
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 in a web farm. Would there be a significant performance increase by adding it to the global cache object, instead of reading the version info every time through reflection for the version that's set in the AssemblyInfo file?(Instead of just the...
4
1283
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 directory when the program comes there i read the memory leakes can come can u plz suggest the best way of implemening Reflection in this senario.Some good tutorial links will be much helpful
5
4580
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 constructors (because we do not allow developers to instantiate them directly). Because our business objects are instantiated very frequently, the idea of using reflection sounds like a performance killer (I haven't done any tests on this, but the...
4
2195
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 inherit my base page class (which in turn inherits System.Web.UI.Page). Behold the following code: For Each asm As System.Reflection.Assembly In System.AppDomain.CurrentDomain.GetAssemblies() For Each mdl As System.Reflection.Module In...
83
4236
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 it too? Once I saw a website comparing Prototype to Java and jQuery to Ruby... but now that I read more and more about Prototype, it is said that Prototype actually came from Ruby on Rails development and the creator of Prototype created it...
0
10210
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10039
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9860
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6668
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5297
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3955
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.