?
Solved

SqlDataSource performance difference because of syntax

Posted on 2008-11-07
7
Medium Priority
?
244 Views
Last Modified: 2013-11-05
HI,

Can anybody imform me about exact performance difference when putting code below in one line without linebreaks and spaces? I
 got hunderds of lines of SqlDataSource in a .aspx file and somehow got in my head moving on one line should slighlty improve performance.. Seems not if file got smarly pre-compiled/loaded. Please inform me.

Thanks,
Floris.


    <asp:SqlDataSource ID="SDS_SelectInsertEmail" runat="server" ConnectionString="<%$ ConnectionStrings:Design_DealerdeskConnectionString %>"
        SelectCommandType="StoredProcedure" SelectCommand="proc_SelectInsertEmail">
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="CompanyID" SessionField="CompanyID" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="from_email" />
            <asp:Parameter Name="bcc_email" ConvertEmptyStringToNull="False" />
            <asp:Parameter Name="email_body" />
            <asp:Parameter Name="email_subject" />
        </InsertParameters>
    </asp:SqlDataSource>
0
Comment
Question by:florisb
  • 4
  • 3
7 Comments
 
LVL 20

Accepted Solution

by:
Juan_Barrera earned 225 total points
ID: 22910966
Hi Floris,
It doesn't make any difference. Even more, the SqlDataSource is not rendered, so there is no html optimization you can make.
0
 
LVL 2

Author Comment

by:florisb
ID: 22912101
Thankyou Juan!

hmm, sound like the answer. But surely the performance difference is always EXACTLY ZERO? For example the filesize does shrink a bit by putting on 1 line (less linebreaks); doens't this mean a few microseconds less to load (first run / after app.pool restart?) This would mean difference NOT zero.

Sorry, but ask for confirmation before I accept solution, cause a in general very well respected senior developer (ex-collega) very very strongly explained to me putting them on one line is 'better' (for performance).. ..I just want to be very very sure!!

Thank you.

0
 
LVL 20

Expert Comment

by:Juan_Barrera
ID: 22914013
florisb,
It may be a difference in JavaScript: less size, less downloads, but not for a SqlServerData source control in ASP.NET.
What reasons did that colleague of your had to support his arguments?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:florisb
ID: 22914270
Hi,

reasoning college:
A huge .aspx files with 100+ lines of <SqlDataSource> is some Kb's smaller if you remove tabs/linebreaks, so putting statement 1 in line instead of many, saves little loading time / redering / (pre)compilling --> better performance.
0
 
LVL 2

Author Comment

by:florisb
ID: 22914278
(You already said) a SqlDataSource is not rendered.
I'm not sure SqlDataSource source is completely compiled / partly only precompiled. Depends on settings? I gotta (re)check this part of ASP.NET.. ..hope what you know can answer this for performance relation.
0
 
LVL 20

Expert Comment

by:Juan_Barrera
ID: 22915105
florisb,
Has your collegue compared the code generated by a SqlDataSource written in separate lines against one written in just one line? A quick look with ILDASM will prove he is wrong.
Anyway, not wanting to enter a discussion here, so, I repeat what I've said in the first post: There is no difference.
0
 
LVL 2

Author Closing Comment

by:florisb
ID: 31514495
thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month16 days, 5 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question