performance

How to find root cause for "too many connections" error in MySQL/PHP

I'm running a web service which runs algorithms that serve millions of calls daily and run some background processing as well. Every now and than I see "Too many connections" error in attempts to connect to the MySQL box" for a few seconds. However this is not necessarily attributed to high traffic times or anything I can put my finger o...

Java performance problem with LinkedBlockingQueue

Hello, this is my first post on stackoverflow... I hope someone can help me I have a big performance regression with Java 6 LinkedBlockingQueue. In the first thread i generate some objects which i push in to the queue In the second thread i pull these objects out. The performance regression occurs when the take() method of the Linked...

Perf4j Not Logging Correctly

I setup some stop watch calls in my code to measure some code blocks and all the messages are going into my primary log and not into the timing log. The perfStats.log file gets created just fine but all the messages go to the root log which I didn't think was supposed to happen according to the docs I've read. Is there something obvious ...

What is the fastest (to access) struct-like object in Python?

I'm optimizing some code whose main bottleneck is running through and accessing a very large list of struct-like objects. Currently I'm using namedtuples, for readability. But some quick benchmarking using 'timeit' shows that this is really the wrong way to go where performance is a factor: Named tuple with a, b, c: >>> timeit("z = a...

Is there a performance hit when running obfuscated code?

All, I am proposing the addition of code obfuscation to the standard build process at my organization. One of the questions being asked is whether there is a performance hit to running obfuscated code vs. running unobfuscated code. What is your experience? Have you seen a reduction in performance at runtime because you obfuscated your ...

what can cause large discrepancy between minor GC time and total pause time?

We have a latency-sensitive application, and are experiencing some GC-related pauses we don't fully understand. We occasionally have a minor GC that results in application pause times that are much longer than the reported GC time itself. Here is an example log snippet: 485377.257: [GC 485378.857: [ParNew: 105845K->621K(118016K), 0.0...

Could this WPF code benefit from Parallel.For and how ?

Hi, I'm wondering if there is a way to convert this so it would be more performant by using a Parallel.For for example. public FrameworkElement FindIntersectingElement(Rect rectangle, UIElement activeElement) { foreach (var child in this.Children) { if (child != activeElement) { if (GetBounds(chi...

Building XML with PHP - Performance in mind..

When building XML in PHP, is it quicker to build a string, then echo out the string or to use the XML functions that php gives you? Currently I'm doing the following: UPDATED to better code snippet: $searchParam = mysql_real_escape_string($_POST['s']); $search = new Search($searchParam); if($search->retResult()>0){ $xmlRes = $sea...

Why would restarting MySQL make my site faster?

hey all, my site started dragging lately, the queries taking exceptionally longer than I would expect with properly tuned indexes. I just restarted the mysql server after 31 days uptime and every query is now substantially faster and the whole site renders 3-4 times faster. Would there be anything that jumps out at you as to why this ...

SQL Better performance: char(10) and trim or varchar(10)

I have a database that uses codes. Each code can be anywhere from two characters to ten characters long. In MS SQL Server, is it better for performance to use char(10) for these codes and RTRIM them as they come in, or should I use varchar(10) and not have to worry about trimming the extra whitespace? I need to get rid of the whitespace...

Strange behavior with large Object Types

I recognized that calling a method on an Oracle Object Type takes longer when the instance gets bigger. The code below just adds rows to a collection stored in the Object Type and calls the empty dummy-procedure in the loop. Calls are taking longer when more rows are in the collection. When I just remove the call to dummy, performance ...

Queue-like data structure with fast search and insertion

I need a datastructure with the following properties: It contains integer numbers. Duplicates aren't allowed (that is, it stores at most one of any integer). After it reaches the maximal size the first element is removed. So if the capacity is 3, then this is how it would look when putting in it sequential numbers: {}, {1}, {1, 2}, {1,...

Is there any way to profile the performance of views in ASP.NET MVC?

Hi, I am profiling my MVC app and the speed from the Performance Explorer is around 500 ms (50 ms code, 450ms SQL roundtrips that won't exist in deployment). However, the time taken waiting on a response to a GET request is around 1200ms. I've managed to discover through trial and error that this is due to a particularly slow partial ...

Is recursion ever faster than looping?

I know that recursion is sometimes a lot cleaner than looping, and I'm not asking anything about when I should use recursion over iteration, I know there are lots of questions about that already. What I'm asking is, is recursion ever faster than a loop? To me it seems like, you would always be able to refine a loop and get it to perform...

dynamic insert php mysql and performance

I have a folder/array of images, it may be 1, maximum of 12. What I need to do is dynamically add them so the images are added to an images table. At the moment I have $directory = "portfolio_images/$id/Thumbs/"; $images = glob("" . $directory . "*.jpg"); for ( $i= 0; $i <= count($images); $i += 1) { mysql_query("INSERT INTO pr...

Is usage of Custom Attributes in C# is memory/performance bottleneck ?

i wana decroate my methods and gui controls with custom attributes. I want to know how attributes consume memory or affects the application performance. What is the lifecycle of Attribute. means when an object of a class with custom attributes in methods, properties and on its own. is instantiated and then disposed. IF all custom attribe...

Jerky Silverlight 4 animations when running app in OOB

I was playing with new Silverlight 4 and to my surprise when I run my sample application in OOB all animations become very jerky when I moved mouse around during animations, but when I run my app in browser animations are smooth even when moving mouse around. I tried my app on two different computers, turned on GPU acceleration in OOB s...

MYSQL Convert rows to columns performance problem

I am doing a query that converts rows to columns similar to this post but have encountered a performance problem. Here is the query:- SELECT Info.Customer, Answers.Answer, Answers.AnswerDescription, Details.Code1, Details.Code2, Details.Code3 FROM Info LEFT OUTER JOIN Answers ON Info.AnswerID = Answer...

Reading Web.config Many times and performance

If i am reading one of my application settings from the web.config everytime when each of my ASP.NET page loads,Would it be a performance issue ?I m concerned about memory too. ...

faster way to draw an image

im trying to combine two images into a single image. unfortunately this has to be done very quickly in response to a user sliding a UISlider. i can combine the two images into a single image no problem. but the way I'm doing it is horribly slow. the sliders stick and jump rather frustratingly. i don't think i can throw the code into a ba...