performance

Does use of anonymous functions affect performance?

I've been wondering, is there a performance difference between using named functions and anonymous functions in Javascript? for (var i = 0; i < 1000; ++i) { myObjects[i].onMyEvent = function() { // do something }; } vs function myEventHandler() { // do something } for (var i = 0; i < 1000; ++i) { myObjects[i...

Is there a more efficient text spooler than TextWriter/StringBuilder

For a situation like capturing text incrementally, for example if you were receiving all of the output.write calls when a page was rendering, and those were being appended into a textwriter over a stringbuilder. Is there a more efficient way to do this? Something that exists in dotnet already preferably? Especially if there's a total si...

Files on XP: Is turning off "last access time" safe?

I'm desperately looking for cheap ways to lower the build times on my home PC. I just read an article about disabling the Last Access Time attribute of a file on Windows XP, so that simple reads don't write anything back to disk. It's really simple too. At a DOS-prompt write: fsutil behavior set disablelastaccess 1 Has anyone ...

Case insensitive search on Sybase

I have been sick and tired Googling the solution for doing case-insensitive search on Sybase ASE (Sybase data/column names are case sensitive). The Sybase documentation proudly says that there is only one way to do such search which is using the Upper and Lower functions, but the adage goes, it has performance problems. And believe me th...

How to clear connections in Sql Server 2005

My workplace has sales people using a 3rd party desktop application that connects directly the a Sql Server and the software is leaving hundreds of sleeping connections for each user. Is there anyway to clear these connection programmatically? ...

ReSharper sluggishness

I like ReSharper, but it is a total memory hog. It can quickly swell up and consume a half-gig of RAM without too much effort and bog down the IDE. Does anybody know of any way to configure it to be not as slow? ...

Why is using Javascript eval function a bad idea?

The eval function is a powerful and easy way to dynamically generate code so what are the caveats? ...

STL Alternative

I really hate using STL containers because they make the debug version of my code run really slowly. What do other people use instead of STL that has reasonable performance for debug builds? I'm a game programmer and this has been a problem on many of the projects I've worked on. It's pretty hard to get 60 fps when you use STL container...

When do transactions become more of a burden than a benefit?

Transactional programming is, in this day and age, a staple in modern development. Concurrency and fault-tolerance are critical to an applications longevity and, rightly so, transactional logic has become easy to implement. As applications grow though, it seems that transactional code tends to become more and more burdensome on the scala...

Perl: why is the if statement slower than "and"?

In Perl, a conditional can be expressed either as if (condition) { do something } or as (condition) and do { do something } Interestingly, the second way seems to be about 10% faster. Does anyone know why? ...

How do you do performance testing in Ruby webapps?

I've been looking at ways people test their apps in order decide where to do caching or apply some extra engineering effort, and so far httperf and a simple sesslog have been quite helpful. What tools and tricks did you apply on your projects? ...

Performance when checking for duplicates

I've been working on a project where I need to iterate through a collection of data and remove entries where the "primary key" is duplicated. I have tried using a List<int> and Dictionary<int, bool> With the dictionary I found slightly better performance, even though I never need the Boolean tagged with each entry. My expectation ...

MySQL slow query log - how slow is slow?

What do you find is the optimal setting for mysql slow query log parameter, and why? ...

Which is the best tool for automatic GUI performance testing?

We are currently testing a Java Swing application for it's performance. I wonder if there is a good tool to automate this? ...

How can you get database specific performance metrics for things like CPU/Memory/etc. in SQL Server 2005?

I have a couple databases on a shared SQL Server 2005 cluster instance, that I would like performance metrics on. I have some processes that run for a very long time and suspect that code inefficiencies, rather than insufficient hardware are to blame. I would like some way to get these performance metrics so that I can rule out the data...

Are Java 6's performance improvements in the JDK, JVM, or both?

I've been wondering about the performance improvements touted in Java SE 6 - is it in the compiler or the runtime? Put another way, would a Java 5 application compiled by JDK 6 see an improvement run under JSE 5 (indicating improved compiler optimization)? Would a Java 5 application compiled by JDK 5 see an improvement run under JSE 6 (i...

SQL Server post-join rowcount underestimate

The Query Optimizer is estimating that the results of a join will have only one row, when the actual number of rows is 2000. This is causing later joins on the dataset to have an estimated result of one row, when some of them go as high as 30,000. With a count of 1, the QO is choosing a loop join/index seek strategy for many of the join...

How to optimize an application to make it faster?

I have created an application executable, it works, but it runs too slow, a lot slower than needed. I would like to make it faster. What can I do to optimize it? ...

Is FileStream lazy-loaded in .NET?

I have a question about using streams in .NET to load files from disk. I am trying to pinpoint a performance problem and want to be sure it's where I think it is. Dim provider1 As New MD5CryptoServiceProvider Dim stream1 As FileStream stream1 = New FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.Read) provider1.ComputeH...

What is quicker, switch on string or elseif on type?

Lets say I have the option of identifying a code path to take on the basis of a string comparison or else iffing the type: Which is quicker and why? switch(childNode.Name) { case "Bob": break; case "Jill": break; case "Marko": break; } if(childNode is Bob) { } elseif(childNode is Jill) { } else if(childNo...