performance

Debugging SQL Server Slowness: Same Database, Different Servers

For a while now we've been having anecdotal slowness on our newly-minted (VMWare-based) SQL Server 2005 database servers. Recently the problem has come to a head and I've started looking for the root cause of the issue. Here's the weird part: on the stored procedure that I'm using as a performance test case, I get a 30x difference in t...

Performance Improvement: Alternative for array_flip function.

Is there any way I can avoid using array_flip to optimize performance. I am doing a select statement from database, preparing the query and executing it and storing data as an associative array in $resultCollection and than I have array op and for each element in $resultCollection am storing its outputId in op[] as evident from the code....

Python: speed up removal of every n-th element from list.

I'm trying to solve this programming riddle and although the solution (see code below) works correctly, it is too slow for succesful submission. Any pointers as how to make this run faster (removal of every n-th element from a list)? Or suggestions for a better algorithm to calculate the same; seems I can't think of anything else than ...

JavaScript replace with callback - performance question

In JavaScript, you can define a callback handler in regex string replace operations: str.replace(/str[123]|etc/, replaceCallback); Imagine you have a lookup object of strings and replacements. var lookup = {"str1": "repl1", "str2": "repl2", "str3": "repl3", "etc": "etc" }; and this callback function: var replaceCallback = functio...

How to determine cpu, ram needed for rails app?

What is the most accurate way to determine the amount of cpu speed and ram needed to run my rails app? I believe there are stress testing tools like Tsung, but how do I determine, for example, that I need X more ram, or X more CPU? I would like to find some way to roughly gauge the performance needs of my application so I can anticipat...

List of Big-O for PHP functions

After using PHP for a while now, I've noticed that not all PHP built in functions as fast as expected. Consider the below two possible implementations of a function that finds if a number is prime using a cached array of primes. //very slow for large $prime_array $prime_array = array( 2, 3, 5, 7, 11, 13, .... 104729, ... ); $result_arra...

Why does my finite state machine take so long to execute?

Hello all :) I'm working on a state machine which is supposed to extract function calls of the form /* I am a comment */ //I am a comment pref("this.is.a.string.which\"can have QUOTES\"", 123456); where the extracted data would be pref("this.is.a.string.which\"can have QUOTES\"", 123456); from a file. Currently, to process a 41kb fil...

Efficient code to avoid circular references in c# object model

I have an excel like grid where values can be typed referencing other rows To check for circular references when a new value is entered, i traverse the tree and create a list of values referenced thus far, if the current value is found in this list, i return an error thus avoiding a circular reference. This is infrequent enough where ex...

Detecting when Javascript is performing poorly

I'm working on a webapp in jquery that, on older machines or machines without much resources, may perform poorly. To get around this I'd like to make a degraded version that disables some of the features, particularly those that rely on large images. How can I tell if my app is running poorly on the user's computer in jquery or javascri...

SQL Server 2005 - Understanding ouput of DBCC SHOWCONTIG

I'm seeing some slow performance on a SQL Server 2005 database. I've been doing some research regarding SQL Server performance but I'm having difficulty fully understanding the output of SHOWCONTIG and would be very grateful if someone could have a look and offer some suggestions to improve performance. TABLE level scan performed. Pag...

Iphone 3GS 3D performance after upgrade to OS 3.1.3

At my company we noticed a significantly worse performance of our game running on a 3GS with OS 3.0 compared to another with OS 3.1.3. To verify I upgraded the second 3GS to OS 3.1.3 as well and now it also runs slow. Did anyone experience anything similar? ...

If a table has two xml columns, will inserting records be a lot slower?

Is it a bad thing to have two xml columns in one table? + How much slower are these xml columns in terms of updating/inserting/reading data? In profiler this kind of insert normally takes 0 ms, but sometimes it goes up to 160ms: declare @p8 xml set @p8=convert(xml,N'<interactions><interaction correct="false" score="0" id="0" gapid=...

Sql Server 2000 Stored Procedure Prevent Parallelism or something?

I have a huge disgusting stored procedure that wasn't slow a couple months ago, but now is. I barely know what this thing does and I am in no way interested in rewriting it. I do know that if I take the body of the stored procedure and then declare/set the values of the parameters and run it in query analyzer that it runs more than 20x...

MSMQ Practices for Performance Testing

We're adding support for MSMQ to our product, and I'm responsible for performance testing the application. I have no experience with MSMQ (we currently support IBM WebSphere MQ ), so I thought I'd come here and ask the experts: For administrative tasks, is there a command line interface for MSMQ? Things like backing up and restoring qu...

What can we do to make XML processing faster?

We work on an internal corporate system that has a web front-end as one of its interfaces. The front-end (Java + Tomcat + Apache) communicates to the back-end (proprietary system written in a COBOL-like language) through SOAP web services. As a result, we pass large XML files back and forth. We believe that this architecture has a sig...

Speed up :visible:input selector avoiding filter

I have a jQuery selector that is running way too slow on my unfortunately large page: $("#section").find(":visible:input").filter(":first").focus(); Is there a quicker way to select the first visible input without having to find ALL the visible inputs and then filtering THAT selection for the first? I want something like :visible:inpu...

How well does Scala Perform Comapred to Java?

The Question actually says it all. The reason behind this question is I am about to start a small side project and want to do it in Scala. I am learning scala for the past one month and now I am comfortable working with it. The scala compiler itself is pretty slow (unless you use fsc). So how well does it perform on JVM? I previously w...

Java marshaller performance

Hi, I've used JAXB Marshaller as well as my own marshaller for marshalling pure java bean objects into XML. It has been observed that both of them require almost same time to marshal. The performance is not acceptable and needs to be improved. What are possible ways where we can improve performance of marshaller? Like threading? ...

how does array_diff work?

I just wonder how array_diff() works.And obviously it couldn't work as follows function array_diff($arraya, $arrayb) { $diffs = array(); foreach ($arraya as $keya => $valuea) { $equaltag = 0; foreach ($arrayb as $valueb) { if ($valuea == $valueb) { $equalta...

Are typed functional languages faster?

I heard the binary compiled from typed functional languages runs faster than otherwise. Is it true? If so, why is that? Normally, do typed languages produce faster binaries? ...