performance

Large XML parcels and using attributes or elements

I understand that there's no universal answer to the attribute vs. element debate (and I read through the other questions I saw on this), but any insight into this particular circumstance would be greatly appreciated. In our case we're going to be receiving very large amounts of master and transactional data from a system of record to...

rss parsing using XLinq question

So I started learning XLinq last evening and I thought I would try to parse a samle RSS document like found at http://weblogs.asp.net/scottgu/rss.aspx My test was to find all entries which fit the following criteria a) Was Posted in the year 2008 b) Had atleast one comment c) Had the tag ".NET" So I am wondering if my solution(though ...

What is setTimeout(function(){//dostuff}, 0); actually supposed to do?

Does this pattern: setTimeout(function(){ // do stuff }, 0); Actually return control to the UI from within a loop? When are you supposed to use it? Does it work equally well in all browsers? ...

What's the most performant way to divide two integral values and obtain a floating point quotient in .NET?

Consider the following signature in C#: double Divide(int numerator, int denominator); Is there a performance difference between the following implementations? return (double)numerator / denominator; return numerator / (double)denominator; return (double)numerator / (double)denominator; I'm assuming that both of the above return ...

Performance in SQL Mobile with one big column that's not being selected

I have a SQL Mobile database with one table. It has several columns with useful, often queried data and one column that stores a relatively large string per record (1000+ characters) that is not queried often. Imagine this fake schema, the "lifeStory" field is the large one. table1 String firstName String lastName String address String...

Best Collection To Use?

Hi There, I am reading log files but not all lines want to be processed straight away. I am using a queue / buffer to store the lines while they wait to be processed. This queue is regularly scanned for particular lines - when they are found, they are removed from the queue (they can be anywhere in it). When there isn't a particular li...

Performance metrics on specific routines: any best practices?

I'd like to gather metrics on specific routines of my code to see where I can best optimize. Let's take a simple example and say that I have a "Class" database with multiple "Students." Let's say the current code calls the database for every student instead of grabbing them all at once in a batch. I'd like to see how long each trip to th...

How big can a Sourcesafe DB be before "problems" arise?

We use SourceSafe 6.0d and have a DB that is about 1.6GB. We haven't had any problems yet, and there is no plan to change source control programs right now, but how big can the SourceSafe database be before it becomes an issue? Thanks ...

STL::Map - Walk through list or use find?

Say I have a method that needs to pull 8 values from a map with 100 elements in it. Which do you think would be preferable: Walk in a for loop from begin to end once, pulling the elements out by switching on the key? Or using find 8 times to get those values? ...

Does C# optimize the concatenation of string literals?

For instance, would the compiler know to translate string s = "test " + "this " + "function"; to string s = "test this function"; and thus avoid the performance hit with the string concatenation? ...

How to work around a potential performance issue when using a Grails hasMany relation?

Given the following domain classes: class Post { SortedSet tags static hasMany = [tags:Tag] } class Tag { static belongsTo = Post static hasMany = [posts:Post] } From my understanding so far, using a hasMany will result in hibernate SET mapping. However, in order to maintain uniqueness/order, Hibernate needs to load t...

Effects of branch prediction on performance?

When I'm writing some tight loop that needs to work fast I am often bothered by thoughts about how the processor branch prediction is going to behave. For instance I try my best to avoid having an if statement in the most inner loop, especially one with a result which is not somewhat uniform (say evaluates to true or false randomly). ...

SQL Server - Query Execution Plan For Conditional Statements

How do conditional statements (like IF ... ELSE) affect the query execution plan in SQL Server (2005 and above)? Can conditional statements cause poor execution plans, and are there any form of conditionals you need to be wary of when considering performance? ** Edited to add ** : I'm specifically referring to the cached query execu...

Can you estimate an application's performance before testing?

It's a tricky question I was asked the other day... We're working on a pretty complex telephony (SIP) application with mixed C++ and PHP code with MySQL databases and several open source components. A telco engineer asked us to estimate the performance of the application (which is not ready yet).. He went like 'well, you know how many p...

Does VB.NET optimize the concatenation of string literals?

Similar to this question, but for VB.NET since I learned this is a language thing. For instance, would the compiler know to translate Dim s As String = "test " + "this " + "function" to Dim s As String = "test this function" and thus avoid the performance hit with the string concatenation? ...

What is the performance hit of Performance Counters

When considering using performance counters as my companies' .NET based site, I was wondering how big the overhead is of using them. Do I want to have my site continuously update it's counters or am I better off to only do when I measure? ...

C# penalty for number of lines of code?

Are there limits or performance penalties on the amount of code inside of my home.cs form? I am writing a database application front-end in C# in Visual Studio 2008. The way things are lining up, I am using a tab-page way of changing the info shown to the end users, instead of using new forms. Coming from VBA/MS Access, I remember tha...

How much computation is behind a HttpContext.Current call?

Is it expensive? I am developing an HtmlHelper that renders directly to Response.Output in order to save unnecesary string creation and I need to choose between: <% Validator.RenderClient(Response.Output); %> and <% Validator.RenderClient(); %> and get the textWriter from HttpContext.Current.Response ...

.NET performance tips for enterprise web appilcations.

Hi, For enterprise web apps, every little bit counts. What performance tips can you share to help programmers program more effeciently? To start it off: Use StringBuilders over strings since strings are Mutable (they get re-created everytime you modify them). Avoid using Datasets as they are very bloated, using SqlReader instead. ...

What can I do to optimize my .NET Web sites and applications for 64-bit?

How can I take full advantage of 64-bit architecture in my .NET 2.0 Web Applications and Console/Forms Applications? ...