473,396 Members | 1,722 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.

Performance Issues raised during Programming in asp.net and vb.net

Hi all,
I am using asp.net to create few dropdowns on the page for date and time. I dont want to use calender control, as it is too huge for the application and I dont want to use multi view either so as to finish off the processing on the same page at once. The two approaches are as follows:

Dim DateList() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}

Approach 1:

Drop1.datasource = datelist
Drop1.databind
Drop2.datasource = datelist
drop2.databind
.
.
.
.
and similarly for about 5 to 6 drop downs.

Approach 2:

For i = 1 to 31
Drop1.items.add(i)
Drop2.items.add(i)
.
.
.
Next

Which one is better for the server performance. Any help with some explaination would be appreciated.

Cheers.
Rasesh.
Jul 16 '07 #1
2 1159
nateraaaa
663 Expert 512MB
Hi all,
I am using asp.net to create few dropdowns on the page for date and time. I dont want to use calender control, as it is too huge for the application and I dont want to use multi view either so as to finish off the processing on the same page at once. The two approaches are as follows:

Dim DateList() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31}

Approach 1:

Drop1.datasource = datelist
Drop1.databind
Drop2.datasource = datelist
drop2.databind
.
.
.
.
and similarly for about 5 to 6 drop downs.

Approach 2:

For i = 1 to 31
Drop1.items.add(i)
Drop2.items.add(i)
.
.
.
Next

Which one is better for the server performance. Any help with some explaination would be appreciated.

Cheers.
Rasesh.
Approach 1 should be less server intensive because the list is already built. All that has to be done is binding the data to the drop down list. In approach 2 the server will spend more time because it has to loop from 1 to 31 and add the item to each drop down list. However, a simple loop such as this should not be noticed by the end user. Does you application have other areas that are dragging down performance?

Nathan
Jul 16 '07 #2
Plater
7,872 Expert 4TB
I am fairly certain that, internally, the databind command just itterates through the datasource and adds the items.
For collections as small as date selections, you won't even notice a difference.

If it really matters, try creating a DateTime object before and after all the calls and then comparing them. Which took more time? (Not sure the unit of measure is small enough though)

Approach 1 should be less server intensive because the list is already built. All that has to be done is binding the data to the drop down list. In approach 2 the server will spend more time because it has to loop from 1 to 31 and add the item to each drop down list. However, a simple loop such as this should not be noticed by the end user. Does you application have other areas that are dragging down performance?

Nathan
Jul 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: sandy | last post by:
Hi All, I am a newbie to MySQL and Python. At the first place, I would like to know what are the general performance issues (if any) of using MySQL with Python. By performance, I wanted to...
5
by: PeterCMG | last post by:
I am currently working on creating guidelines for designing client/server applications for performance. I am looking for any existing documentation that would assist with this and my google...
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...
4
by: Martin | last post by:
I am using graphics as backgrounds for forms,buttons,labels etc. The question is: is it faster to load all graphics from files on app start or to use it embeded (places in editor during design)....
19
by: Tom Jastrzebski | last post by:
Hello, I was just testing VB.Net on Framework.Net 2.0 performance when I run into the this problem. This trivial code attached below executed hundreds, if not thousand times faster in VB 6.0...
22
by: Kevin Murphy | last post by:
I'm using PG 7.4.3 on Mac OS X. I am disappointed with the performance of queries like 'select foo from bar where baz in (subquery)', or updates like 'update bar set foo = 2 where baz in...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
3
by: rAinDeEr | last post by:
Hi, Is there any performance issues related to having default timestamps in tables? I have a Data Model in which all the tables have created_tms and last_updated_tms which I have set default...
5
by: Suhas Vengilat | last post by:
Hi All, In one of the project discussions, one team member raised a question whether the usage of asp.net validation controls (like RequiredFieldValidator, CustomValidator, RegularExpression...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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.