473,396 Members | 1,879 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,396 software developers and data experts.

Latebinding or Webcontrols for best performance?

I currently populate my datagrids manually from a
codebehind and use webcontrols within the template columns
(for check boxes and viewing pleasure eg labels)

For performance and scalability... would late binding
where I'd just have <%=myVar%> really be a better way of
doing things?

I always had thought creating a webcontrol and populating
from codebehind was more optimized becase it was pre-
compiled.

Thanks
Weston Weems
Nov 18 '05 #1
4 1493
As far as asp.net goes, I wouldn't suggest using <%= %> if you can accomplish it from codebehind, it breaks the nice separation between code and html source. Compiled code is faster, and like you said using <%= %> doesn't get compiled until runtime, which takes a bit longer, but the performance difference wouldn't be anything to cry home about. As far as scalability, you'll want to stick with codebehind.

--Michael

"Weston Weems" <an*******@discussions.microsoft.com> wrote in message news:0b****************************@phx.gbl...
I currently populate my datagrids manually from a
codebehind and use webcontrols within the template columns
(for check boxes and viewing pleasure eg labels)

For performance and scalability... would late binding
where I'd just have <%=myVar%> really be a better way of
doing things?

I always had thought creating a webcontrol and populating
from codebehind was more optimized becase it was pre-
compiled.

Thanks
Weston Weems

Nov 18 '05 #2
Hrmm... I've heard arguments both ways... basically people
against the webcontrol's argument was simply that you had
to account for creation and gc of all the webcontrols.

Say I had a datagrid with 5 columns and 100 records, there
is 500 labels in memory (at least at the time of binding
anyway)

I could see how that route could cause some trouble in
resource management.

Anyway, anyone else have any input?
-----Original Message-----
As far as asp.net goes, I wouldn't suggest using <%= %> if you can accomplish it from codebehind, it breaks the
nice separation between code and html source. Compiled
code is faster, and like you said using <%= %> doesn't get
compiled until runtime, which takes a bit longer, but the
performance difference wouldn't be anything to cry home
about. As far as scalability, you'll want to stick with
codebehind.
--Michael

"Weston Weems" <an*******@discussions.microsoft.com>

wrote in message news:0b8601c48b8a$2d63a7f0
$a*******@phx.gbl...
I currently populate my datagrids manually from a
codebehind and use webcontrols within the template columns (for check boxes and viewing pleasure eg labels)

For performance and scalability... would late binding
where I'd just have <%=myVar%> really be a better way of doing things?

I always had thought creating a webcontrol and populating from codebehind was more optimized becase it was pre-
compiled.

Thanks
Weston Weems

.

Nov 18 '05 #3
Every situation is unique, performance questions like these tend to be
slightly pointless (sorry). I'm not sure who's against web controls, my
guess is that they are doing very unique things (in which case asp.net as a
whole might not be well suited for there needs (although i even doubt this))
or they simply don't have much experience.

With performance, like most things, there's a law of diminishing return.
There are things you can spend minutes on to get huge gains (and you should
'cuz they are good practice)...what you are talking about will take you huge
time (maintenance and bugs) and gain your tiny performance gains (and you
shouldn't 'cuz its bad practice). Look at your own requirements if you need
an example. You could give yourself a headache by maintaining <%='s in 500
cells and gain 1/4 second per request. Or you could save yourself a lot of
trouble, create a solid caching strategy and gain 8 times that amount.

With performance, again like most things, things aren't black and white.
The extra performance you'll incur will save you $$$ in maintenance and
staff, which you could use to buy better hardware, which might cost you more
to host, but which might give you better uptime, which might.....
Karl
"Weston Weems" <an*******@discussions.microsoft.com> wrote in message
news:0d****************************@phx.gbl...
Hrmm... I've heard arguments both ways... basically people
against the webcontrol's argument was simply that you had
to account for creation and gc of all the webcontrols.

Say I had a datagrid with 5 columns and 100 records, there
is 500 labels in memory (at least at the time of binding
anyway)

I could see how that route could cause some trouble in
resource management.

Anyway, anyone else have any input?
-----Original Message-----
As far as asp.net goes, I wouldn't suggest using <%= %>

if you can accomplish it from codebehind, it breaks the
nice separation between code and html source. Compiled
code is faster, and like you said using <%= %> doesn't get
compiled until runtime, which takes a bit longer, but the
performance difference wouldn't be anything to cry home
about. As far as scalability, you'll want to stick with
codebehind.

--Michael

"Weston Weems" <an*******@discussions.microsoft.com>

wrote in message news:0b8601c48b8a$2d63a7f0
$a*******@phx.gbl...
I currently populate my datagrids manually from a
codebehind and use webcontrols within the template columns (for check boxes and viewing pleasure eg labels)

For performance and scalability... would late binding
where I'd just have <%=myVar%> really be a better way of doing things?

I always had thought creating a webcontrol and populating from codebehind was more optimized becase it was pre-
compiled.

Thanks
Weston Weems

.

Nov 18 '05 #4
Depends on what you're doing in the code-behind i.e. how many controls are
being created/modified and how much work is being done with the control
tree. I would suggest in most cases using the databinding syntax in your
webform (<%#%> latebound) is almost certainly slower and should be avoided
where possible.
Of course, the only way to totally understand the effects of either approach
is to test your application with a load testing tool such as ACT or
Microsoft's other stress tool (freely available) WAST or Homer as it is
known.
Making assumptions regarding performance is a risky business.

--
Ben
http://bitarray.co.uk/ben
"Weston Weems" <an*******@discussions.microsoft.com> wrote in message
news:0d****************************@phx.gbl...
Hrmm... I've heard arguments both ways... basically people
against the webcontrol's argument was simply that you had
to account for creation and gc of all the webcontrols.

Say I had a datagrid with 5 columns and 100 records, there
is 500 labels in memory (at least at the time of binding
anyway)

I could see how that route could cause some trouble in
resource management.

Anyway, anyone else have any input?
-----Original Message-----
As far as asp.net goes, I wouldn't suggest using <%= %>

if you can accomplish it from codebehind, it breaks the
nice separation between code and html source. Compiled
code is faster, and like you said using <%= %> doesn't get
compiled until runtime, which takes a bit longer, but the
performance difference wouldn't be anything to cry home
about. As far as scalability, you'll want to stick with
codebehind.

--Michael

"Weston Weems" <an*******@discussions.microsoft.com>

wrote in message news:0b8601c48b8a$2d63a7f0
$a*******@phx.gbl...
I currently populate my datagrids manually from a
codebehind and use webcontrols within the template columns (for check boxes and viewing pleasure eg labels)

For performance and scalability... would late binding
where I'd just have <%=myVar%> really be a better way of doing things?

I always had thought creating a webcontrol and populating from codebehind was more optimized becase it was pre-
compiled.

Thanks
Weston Weems

.

Nov 18 '05 #5

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

Similar topics

5
by: Fabrizio | last post by:
HI, How i can use the Microsoft.Web.UI.WebControls reference inside a web project? There is any DLL to add? Thank you, Fabrizio
2
by: Weston Weems | last post by:
Ok, I first of all dont know if thats the proper verbage.. lemme explain... Originally I was taught to handle databinding in a datagrid and such with Databinder.Eval from the template. Since...
4
by: Daniel Groh | last post by:
Hi, I'm newbie to ASP.Net and I'd like to know the best way and when shoul I use WebControls and HTML Controls, what is the difference ? I'm developing a login system but i don't know if i use the...
0
by: RJN | last post by:
Hi all I'm calling a shared method in the class. This error appears in production though I'm not able to reproduce. Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type...
0
by: RJN | last post by:
Hi Sorry for posting again. I'm calling a shared method in the class. The following error is found in production though I'm not able to reproduce. ...
0
by: Jim Duffie | last post by:
Hi, I am trying to build a simple websire using the above in Visual Web Developer. When finished I have build the website and it works fine locally but when I FTP it to the server I am getting a...
1
by: Angelo | last post by:
Ok, I am utilizing the threadpool class to manage a number of threads. Priority is not important to me and neither is if the threads are background or foreground threads so I opted for the...
4
by: Hakan ÖRNEK | last post by:
Hi, I have two dll's like First.dll and Second.dll compiled by vb.net, a object in first.dll and, b object in Second.dll. I need hold cross referances; a.breferance=b and b.areferance=a I...
0
by: Corey66 via DotNetMonster.com | last post by:
Hello! I' ve written a Application, in which I could import all contacts from Outlook into my programme and it works fine, but I use the reference from Outlook 10! My Problem is, that my...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
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...
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,...

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.