By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,760 Members | 955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,760 IT Pros & Developers. It's quick & easy.

Latebinding or Webcontrols for best performance?

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.