performance

MySQL Insert Query Randomly Takes a Long Time

I am using MySQL to manage session data for my PHP application. When testing the app, it is usually very quick and responsive. However, seemingly randomly the response will stall before finally completing after a few seconds. I have narrowed the problem down to the session write query which looks something like this: INSERT INTO Session...

Haskell math performance

I'm in the middle of porting David Blei's original C implementation of Latent Dirichlet Allocation to Haskell, and I'm trying to decide whether to leave some of the low-level stuff in C. The following function is one example—it's an approximation of the second derivative of lgamma: double trigamma(double x) { double p; int i; ...

Writing image to servlet response with best performance

Any advices, practices, experience? Thanks. ...

High CPU Usage with WebGL?

I'm checking out the nightly builds of Firefox and Chromium with support of WebGL with a few demos and tutorials and I can't help but wonder about the extremely high CPU load they cause. A simple demo like this one runs at a sustained 60% of my dual core. The large version of this one maxes out the CPU to 100% and has some visible frame...

Converting keys of an array/object-tree to lowercase

Im currently optimizing a PHP application and found one function being called around 10-20k times, so I'd thought I'd start optimization there. function keysToLower($obj) { if(!is_object($obj) && !is_array($obj)) return $obj; foreach($obj as $key=>$element) { $element=keysToLower($element); ...

Does a servlet-based stack have significant overheads?

I don't know if it's simply because page-loads take a little time, or the way servlets have an abstraction framework above the 'bare metal' of HTTP, or just because of the "Enterprise" in Jave-EE, but in my head I have the notion that a servlet-based app is inherently adding overhead compared to a Java app which simply deals with sockets...

Using Perfmon with MySQL Connector/NET

I am trying to diagnose repeated lock wait timeouts from my ASP.NET app to MySQL 5.1. I'm using MySQL Connector/NET 6.2.3. I don't see anything MySQL-related in Perfmon's Performance Object dropdown list. What else can I do to try to diagnose these issues? ...

C++ switch table performance

Does the time taken by a switch statement (or jump table in compiled form) to "decide" where to jump rise by the number of casees it contains? ...

Why is casting and comparing in PHP faster than is_*?

While optimizing a function in PHP, I changed if(is_array($obj)) foreach($obj as $key=>$value { [snip] } else if(is_object($obj)) foreach($obj as $key=>$value { [snip] } to if($obj == (array) $obj) foreach($obj as $key=>$value { [snip] } else if($obj == (obj) $obj) foreach($obj as $key=>$value { [snip] } After learning about ==...

every language eventually compiled into low-level computer language?

Isn't every language compiled into low-level computer language? If so, shouldn't all languages have the same performance? Just wondering... ...

Monitoring application to monitor a Java desktop application performance

Hey, I have a Java desktop application I wrote, and I would like a recommendation about a monitoring application that can spot bottlenecks in the code and real time memory consumptions. As I was developing for J2Me, the WTK then, had a memory monitor, and I found it really useful, I would like to know which monitoring program you think...

Facebook's pipelining system? How does it work?

One of the facebook developers recently posted an article describing their new approach on handling HTTP requests called BigPipe: http://www.facebook.com/notes/facebook-engineering/bigpipe-pipelining-web-pages-for-high-performance/389414033919 It seems to have obvious performance advantages over the conventional way of doing it. So, is ...

Help with Neuroph neural network

For my graduate research I am creating a neural network that trains to recognize images. I am going much more complex than just taking a grid of RGB values, downsampling, and and sending them to the input of the network, like many examples do. I actually use over 100 independently trained neural networks that detect features, such as l...

Rails: How can I log all requests which take more than 4s to execute?

I have a web app hosted in a cloud environment which can be expanded to multiple web-nodes to serve higher load. What I need to do is to catch this situation when we get more and more HTTP requests (assets are stored remotely). How can I do that? The problem I see from this point of view is that if we have more requests than mongrel cl...

Very simple python functions takes spends long time in function and not subfunctions

I have spent many hours trying to figure what is going on here. The function 'grad_logp' in the code below is called many times in my program, and cProfile and runsnakerun the visualize the results reveals that the function grad_logp spends about .00004s 'locally' every call not in any functions it calls and the function 'n' spends abou...

Filtering MySQL query result according to a interval of timestamp

Let's say I have a very large MySQL table with a timestamp field. So I want to filter out some of the results not to have too many rows because I am going to print them. Let's say the timestamps are increasing as the number of rows increase and they are like every one minute on average. (Does not necessarily to be exactly once every min...

Monitoring disk performance with MRTG

I use MRTG to monitor vital stats on my servers like disk space, CPU load, memory usage, temperatures etc. It all works fine and well for parameters that don't change rapidly. By running small VB script I can also get any Performance Counter. However these scripts are called by MRTG every 5 minutes while performance counters like physi...

mySQL & Relational databases: How to handle sharding/splitting on application level?

Hi everybody, I have thought a bit about sharding tables, since partitioning cannot be done with foreign keys in a mySQL table. Maybe there's an option to switch to a different relational database that features both, but I don't see that as an option right now. So, the sharding idea seems like a pretty decent thing. But, what's a good ...

Time to start a counter on client-side.

Hi everybody, I'm developing an web application using asp.net mvc, and i need to do a stopwatch (chronometer) (with 30 seconds preprogrammed to start in a certain moment) on client-side using the time of the server, by the way, the client's clock can't be as the server's clock. So, i'm using Jquery to call the server by JSon and get the ...

How to increase the performance of a loop which runs for every 'n' minutes.

Hi Giving small background to my requirement and what i had accomplished so far: There are 18 Scheduler tasks run at regular intervals (least being 30 mins) takes input of nearly 5000 eligible employees run into a static method for iteration and generates a mail content for that employee and mails. An average task takes about 9 min mult...