473,398 Members | 2,389 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,398 software developers and data experts.

Performance questions

Hi

I have 2 different sites with the same aspnet code.
Both are running in their own app pool.

1st one is the important site and performance for this one is more important
than the second one.
Of course in the codes I have some customization routines.

One of those routine shows and assigns url for a hyperlink.
For the important (high traffic) site (site 1) I need to show that link and
for the 2nd site I need to hide that link.

Now the question is:
Should I make this hyperlink visible from the HTML part which will be
suitable for site 1 and hide it from codebehind in the second site?
Is there any performance difference doing the vise versa?

The following is the code I have now:
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
}
else
{
hyperlink.Visible = false;
}

However the following code looks nicer but will it give any performance hit
to site 1?
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
hyperlink.Visible = true;
}

Looking forward for your advise.
--

SevDer
http://www.sevder.com
A new source for .NET Developers

Aug 3 '06 #1
4 1322
I don't think this is kind of code would be the performance bottleneck.
Typically it is either related to database access, or complicated
calculations or processing in the code. Setting one property on a hyperlink
isn't going to make a difference.

"SevDer" <se****@newsgroup.nospamwrote in message
news:et**************@TK2MSFTNGP03.phx.gbl...
Hi

I have 2 different sites with the same aspnet code.
Both are running in their own app pool.

1st one is the important site and performance for this one is more
important than the second one.
Of course in the codes I have some customization routines.

One of those routine shows and assigns url for a hyperlink.
For the important (high traffic) site (site 1) I need to show that link
and for the 2nd site I need to hide that link.

Now the question is:
Should I make this hyperlink visible from the HTML part which will be
suitable for site 1 and hide it from codebehind in the second site?
Is there any performance difference doing the vise versa?

The following is the code I have now:
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
}
else
{
hyperlink.Visible = false;
}

However the following code looks nicer but will it give any performance
hit to site 1?
if (Site1)
{
hyperlink.NavigateUrl = "Default.aspx";
hyperlink.Visible = true;
}

Looking forward for your advise.
--

SevDer
http://www.sevder.com
A new source for .NET Developers

Aug 3 '06 #2
I don't think that either of these options will have much of an effect on performance... how often is this code called?

--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Aug 3 '06 #3
Hi,

I don't really have a problem with the performance and the difference
between them is may be 1/10000000 but I just want to know which one is
faster.
May be in the future this information may help me on 100 show or hide items
in one page where there are tremendous amount of hits to that page.

--

SevDer
http://www.sevder.com
A new source for .NET Developers
"Greg Collins [Microsoft MVP]" <gcollins_AT_msn_DOT_comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
I don't think that either of these options will have much of an effect on
performance... how often is this code called?

--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )

Aug 3 '06 #4
Well, if you have to set 2 properties instead of 1, then setting 2 will take
longer.

But even with 100 of these controls, you aren't going to see a difference.
This is just changing a variable in an object. That variable is used when
it's time to generate the corresponding HTML. But by setting the property,
you are just changing some local variable to the object.

Again, unless you have tens of thousands of these, this isn't going to make
a difference. I would focus on more likely bottlenecks in terms of
performance.

"SevDer" <se****@newsgroup.nospamwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Hi,

I don't really have a problem with the performance and the difference
between them is may be 1/10000000 but I just want to know which one is
faster.
May be in the future this information may help me on 100 show or hide
items in one page where there are tremendous amount of hits to that page.

--

SevDer
http://www.sevder.com
A new source for .NET Developers
"Greg Collins [Microsoft MVP]" <gcollins_AT_msn_DOT_comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
I don't think that either of these options will have much of an effect on
performance... how often is this code called?

--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )

Aug 3 '06 #5

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

Similar topics

25
by: Brian Patterson | last post by:
I have noticed in the book of words that hasattr works by calling getattr and raising an exception if no such attribute exists. If I need the value in any case, am I better off using getattr...
0
by: Jack Coxen | last post by:
------_=_NextPart_001_01C3584E.5FF65B60 Content-Type: text/plain; charset="iso-8859-1" I've gone through the mailing list archives, read the appropriate parts of the manual and searched the...
1
by: Tim Smith | last post by:
Hi, I have a table ORDER_DETAIL with 22 million rows which has an index of (person_id, code_id, created_dtt) I have another ORDER table with 5 million rows which has an index of (order_dtt,...
2
by: Unruled Boy | last post by:
1.The follow two ways to declare one object: any difference? especially its performance. a.Private m_objMyObject As MyObject=New MyObject() b.Private m_objMyObject As MyObject m_objMyObject=New...
115
by: Mark Shelor | last post by:
I've encountered a troublesome inconsistency in the C-language Perl extension I've written for CPAN (Digest::SHA). The problem involves the use of a static array within a performance-critical...
13
by: bjarne | last post by:
Willy Denoyette wrote; > ... it > was not the intention of StrousTrup to the achieve the level of efficiency > of C when he invented C++, ... Ahmmm. It was my aim to match the performance...
2
by: 1944USA | last post by:
I am re-architecting a C# application written as a multithreaded Windows Service and trying to squeeze every bit of performance out of it. 1) Does the thread that an object is instantiated on...
11
by: ZenRhapsody | last post by:
Has anyone done any performance testing between new generic Lists and single dimensional arrays? I really like the code flexibility the List provides since I don't know how many items I will...
8
by: Gary Wessle | last post by:
Hi while I am reading this C++ book, I noticed the iterator is being used to loop through a container, say a vector. I am used to use "for(int=0;i<vec.size();++i)" which is better to use? ...
1
by: jehugaleahsa | last post by:
Hello: I am experiencing performance related issues when my custom data structures work with value types. I use generics to prevent boxing wherever I can. For instance, I use IEqualityComparer,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
0
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...

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.