performance-tuning

How to interpret Papi output

I have collected data of Number of L2 cache misses using PAPI. I had run an MPI application with 4 threads (mpirun -np 4) and each thread reads the cache misses in L2. Each thread outputs data for every timestamp. eg: Timestamp data xxx530 thread# 0 2136 xxx531 thread# 0 3217 .. . . . ...

Online Tutorial on I\O completion ports

Are there any good online tutorials on I/O completion ports. I found few of them but they were very highlevel and could not really understand. ...

Java Profiling, Performance Tuning and Memory Profiling exercises

I am about to conduct a workshop profiling, performance tuning, memory profiling, memory leak detection etc. of java applications using JProfiler and Eclipse Tptp. I need a set of exercises that I could offer to participants where they can: Use the tool to to profile the discover the problem: bottleneck, memory leak, suboptimal code etc...

Apache Config for High Page View, Long Session Users - KeepAlive and MaxRequest variables

Hi all, I am currently running a web app that sees several (~15) users logging in once each day, and then leaving the web app open where it automatically refreshes with new content every 5 minutes. Each user tends to have it open for about 15-18 hours. However at critical mass (~30-40) users everything starts to slow down dramatically ...

Allocating memory inside loop vs outside loop

Is there noticeable performance penalty for allocating LARGE chunks of heap memory in every iteration of loop? Of course I free it at the end of each iteration. An alternative would be to allocate once before entering the loop, repeatedly using it in all iterations, and eventually freeing it up after exiting the loop. See the code belo...

Performance of Singleton Class Instance Method vs. Static Class Method in PHP?

Hi all, I'm interested in objective analysis of which is more performant; calling instance methods of a singleton class or methods of a static class. I've already seen this so I'm not looking for a discussion about the difference between the two or a discussion of which is "better." I'm only interested in relative performance between t...

Alternative to DISTINCT Function

Is there a better way to get all distinct values from three columns in one table other than using the DISTINCT function? I've also tried GROUP BY, but there doesn't seem to be any noticeable difference in the cost. SELECT DISTINCT Table1.Col1, Table2.Col1, Table1.Col3 FROM Table1 INNER JOIN Table2 ON Table1.FK = Table2.ID WHERE Table1....

How can I speed up Sonar's package design analysis?

I maintain the build process for a large (> 500,000 LOC) Java project. I've just added a Sonar analysis step to the end of the nightly builds. But it takes over three hours to execute ... This isn't a severe problem (it happens overnight), but I'd like to know if I can speed it up (so that I could run it manually during work hours if d...

How to import *huge* chunks of data to PostgreSQL?

I have a data structure that looks like this: Model Place primary key "id" foreign key "parent" -> Place foreign key "neighbor" -> Place (symmetryc) foreign key "belongtos" -> Place (asymmetric) a bunch of scalar fields ... I have over 5 million rows in the model table, and I need to insert ~50 million rows into ...

SQL Server: How can a table scan be so expensive on a tiny table?

Hi all I'm looking at an execution plan from a troublesome query. I can see that 45% of the plan is taken up doing a table scan on a table with seven (7) rows of data. I am about to put a clustered index to cover the columns in my query on a table with seven rows and it feels...wrong. How can this part of my query take up so much o...

PHP Cli -Helpful Information when developing backend processes

I really just wanted to know a bit more about the PHP Cli with a few more specific questions that I had.. I know that it is much better to use the CLI for more intense background processes than using php on apache, as it helps (save memory?).. however I'm wondering can you run multiple instances of the cli concurrently? IE: having multip...

How to check which stored procedure is taking maximum time in sql server

I want to know what are various methods by which I can monitor which of my procedure, query is taking more time on various components(CPU cycle, scan time etc.) than already set threshold value. I want it to be logged as well. Whenever uses my site and calling some procedure. I want to make a log of all procedures crossing my threshold....

High accuracy cpu timers

An expert in highly optimized code once told me that an important part of his strategy was the availability of extremely high performance timers on the CPU. Does anyone know what those are and how one can access them to test various code optimizations? While I am interested regardless, I also wanted to ask whether it is possible to acc...

jQuery Performance Tuning: Does context always matter?

I'm being asked if there is a difference between two variations on a theme and I honestly don't know the answer. Given the following two functions: $("table").each(function(){ $("td", this).live("hover", function(){ $(this).toggleClass("hover"); }); }); $("table td").each(function(){ $(this).live("hover", function(...

MySQL Updates are taking forever

Hey, im trying to wirte about 600000 Tokens into my MySQL Database Table. The Engine I'm using is InnoDB. The update process is taking forever :(. So my best guess is that I'm totally missing something in my code and that what I'm doing is just plain stupid. Perhaps someone has a spontaneous idea about what seems to eat my performance: ...

drawRect (+setNeedsRedisplay) fills wil unwanted color, slowing iPad down

My iPad application is very simple: There's a Window, with a child View of class ContextView (my own) ContextView's background (as definied in Interface Builder) has a green background, and is Opaque. Clear Context Before Drawing is off (for both Window and UIView.) CADisplayLink selector calls setNeedsDisplay once a frame update. The ...

How to improve Core Data performance?

My app has a UISearchBar allowing user to enter search keywords. Each keystroke executes a Core Data query in order to display the results as text in search bar changes. The problem is that search bar keystrokes are lagging pretty bad... surely because of slow fetching. Any ideas how to improve the performance? My Core Data is backed w...

Visual Studio 2008 - Application running slower once built

Hi, I have a chess game I have created in Visual Studio 2008. It runs very well when I am debugging, but now I have finished and built the program, it lags a bit and I'm finding it a bit annoying as it was running so well in when creating/debugging mode... Can anyone shed some light on this for me, or has any body got any little tricks...

Optimize me! (C, performance) -- followup to bit-twiddling question

Thanks to some very helpful stackOverflow users at Bit twiddling: which bit is set?, I have constructed my function (posted at the end of the question). Any suggestions -- even small suggestions -- would be appreciated. Hopefully it will make my code better, but at the least it should teach me something. :) Overview This function wil...

How to improve this algorithm which fills up a calendar grid?

I have Grid which will render a calendar, and I'm provided with an ArrayList<CalendarEventEntity> which contains events. Those events have to be highlighted in the grid. As I have to fill the grid by my self I have something like this: for( loop through the days of the month ){ Calendar eventDate = event.getDate(); // look for ...