Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DNN Core Development Policy SuggestionDNN Core Development Policy Suggestion
Previous
 
Next
New Post
12/20/2007 3:17 PM
 

In my experience, string concatenation is often the biggest offender when application performance slows.  While DNN is indeed pretty quick, and appears to be quite scalable, I would like to suggest something to the Core Team, and all Project Team members.

There are test results all over the Internet showing that concatenating strings is best done either using StringBuilder, or String.Concat versus the popular method of simply using a "&" or "+".  Case in point, I took a web service that was responding to requests from a response time of 60-90 seconds to 2-5 seconds just by switching the string concatenation throughout the web service (and on some occasions, caching the strings).

I am sure that the Core Team already has some sort of guideline in place for contributing developers.  I would like to suggest that the Core Team have its contributors to use the StringBuilder and String.Concat methods whenever a string is to be concatenated. 

This may seem like a trivial thing to some of you out there, but consider the memory and processor consumption for a string object like this:

Dim strFirstName As String = "John"
Dim strLastName As String = "Dough"
Dim strName As String = String.Empty 
strName = strFirstName & " " & strLastName ' COMMON METHOD
strName = String.Concat(strFirstName, " ", strLastName) ' FASTER METHOD

While if this is called every once in a while, there will not be a noticeable difference to a single user.  However, if this string concatenation method is called many times per page, per module, and per provider for every page request, this adds up to significant resource consumption.  Not only in terms of processor time, and memory usage, but also consider the additional energy required by the servers that are serving up these pages.   For a busy web site or web server, there could be a significant reduction in compilation, rendering, and response time if better string concatenation practices were encouraged. 

(Remember, better "string concatenation practices" does not mean to use StringBuilder for every concatenation scenario, only when it offsets the speed and efficiency problems when scaling for performance overall on an application.  My main point is to never use the "&" or "+" methods.)

I just hope that this post at least strikes up some dialog to get the ball rolling on this.  I look forward to any comments and conversation on this topic.

Here are some easy to find resources related to this topic:


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
12/20/2007 3:43 PM
 

Will this is a great recommendation.  I know I personally have been guilty of this when in a hurry, and I have gone back and most of the time fixed the issues and noticed dramatic improvements in performance.

I think little optimizations like these are items that can go a long way.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
12/21/2007 8:25 AM
 

I honestly thought that this thread would strike a vein in people similar to the DIV vs. TABLE topic.  I was very disappointed this morning to see that you are the only person to reply.  :(

I guess that there are not that many people that care either way?  I don't consider myself an "expert", but the potential performance benefits are unmistakeable.  And consider this...   With being "green" becoming mainstream, if DNN were to overhaul its string concatenation and everyone upgraded their instances of DNN, imagine the energy savings across the globe...  (It would make a great press release.  Wink-wink!)


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
12/21/2007 8:58 AM
 

 

I honestly thought that this thread would strike a vein in people similar to the DIV vs. TABLE topic.  I was very disappointed this morning to see that you are the only person to reply.  :(

It's not that contested of a subject because:

a. It's undeniably true

b. Many developers may not know about the options available with concatenation.

c. The battle between tables vs. divs is really a programmer vs. designer argument.

It makes sense that the core should go through and clean up any & and +, especially in any loops, or client side data objects (repeaters, datalists etc).

 

 
New Post
12/21/2007 9:33 AM
 

Okay...  "tables vs. divs" was a poor example.  :)


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DNN Core Development Policy SuggestionDNN Core Development Policy Suggestion


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out