performance

what is the fastest way to update thousands rows in mysql

lets assume you have a table with 1M rows and growing ... every five minutes of every day you run a python programm which have to update some fields of 50K rows my question is: what is the fastest way to do the work? runs those updates in loop and after last one is executed than fire up a cursor commit? or generate file and than ru...

Database performance: filtering on column vs. seperate table

I was wondering what the best approach would be for the following situation: I have an Orders table in a database that obviously contains all orders. But these are literally ALL orders, so including the complete/finished ones that are just flagged as 'complete'. From all the open orders I want to calculate some stuff (like open amount, ...

iPhone performance tuning: __longcpy consume most cpu time and running very slow on 3GS but very smooth on older version

Hi guys, I'm currently working on a iPhone STG. I developed the system based on a 2D graphic engine developed by other engineers. Both are based on C++. The game run extremely slow on 3GS(about 5~10 fps). I tried 2 version of iOS: 4.1 and 3.1.2, both very slow. But when I installed the game on an iPhone (yes only "iPhone". Not 3G. Not ...

Web browser plugin for jquery performance optimization

Attempting to improve the perforance of my jquery - so step 1 for me is to optimize my selectors. I have been using jsperf.com which has been helpful but is there any web browser plugin that I can use that will do similar as jsperf? ie. I can enter several different selectors and it tell me which is the slowest etc or the timing each sel...

Rail performance on ARM

I was wondering if we could replace our Atom N270 based nettops that are running a Rails(ruby 1.8.6...) webapp with some equivalent ARM based device (we like the fanless setup, power consumption, etc.). The ARM device was XScale-PXA270 @ 520, 128MB (and probably some slower SDRAMs), running linux, there was always enough free memory wi...

Rails3 - why my view loading times are so long?

So one week ago I started to move my old app written in Rails 2.3.5 to new 3.0. Unfortunately, I found out that some of the views are loading surprisingly slow. Example: Rails 2.3.5 Ruby 1.8.7 -> WEBrick: Completed in 297ms (View: 143, DB: 40) Rails 3.0.0 Ruby 1.8.7 -> WEBrick: Completed in 3081ms (View: 261, ActiveRecord: 108) Rails ...

Does the order of fields in a WHERE clause affect performance in MySQL?

I have two indexed fields in a table - type and userid (individual indexes, not a composite). types field values are very limited (let's say it is only 0 or 1), so 50% of table records have the same type. userid values, on the other hand, come from a much larger set, so the amount of records with the same userid is small. Will any of ...

To CTE or not to CTE...

Having been stuck with SQL2000 for far too long, I've not really had a lot of exposure to Common Table Expressions. The answers I've given here (#4025380) and here (#4018793) have gone against the flow in that they didn't use a CTE. I appreciate that for recursion they are the beez kneez, and there are a few queries that can be greatl...

visual studio performance tools, not instrumenting an assembly

I've got a solution which I am trying to profile with instrumentation. The resulting report seems to collect only up to a certain depth, and even though all of the projects have been added in the Targets section, it's not capturing the full stack in a given assembly. Is there a setting I'm missing or something? ...

Yslow performance improvements in the web.config

Running my site on IIS7 and looking to improve my Yslow rating. Working with asp.net. I am able to cache static resources in the web.config but is it possible to the following also: Set the etag on the resources eg. javascript, images, css files etc Add expires header to the above static resources Set gzipping on components Previously...

Getting max resident/working set size of Windows program from CLI, and user & system run times?

On Linux and Mac OS X, I can run a command from the CLI using the "time" command (not the bash shell built-in command time) and get not only the elapsed run time from start to finish, but many other statistics as well. For example on Mac OS X: % /usr/bin/time -lp /usr/bin/wc PS1-01.m4v 6166365 46283357 1532034853 PS1-01.m4v real ...

XBAP Startup Performance Improvements

I have an XBAP application which is approximately 1.3MB in size. I have tried to get the size of the application down to as small as possible but have dependencies on the WPF Toolkit amongst other things and am limited there. Currently I am experiencing slow start ups in the following areas: Initial Download (probably application siz...

Profile slow php pages in production

Is there a way of profiling only slow php pages on a production server? At the moment we're logging slow pages to a text file, but without more information it's hard to say why they're slow (not consistently slow). I've used XDEBUG profiler before, but I really don't want to enable this on our production servers as we are likely to get ...

any reason to not use a dictionary

I was having a discussion with a co-worker over whether it is better to use a Dictionary and repopulate it whenever a result set changes or to just use linq loop over all elements in the list each time. We're trying to map a parent / child relationship, and I suggested using the ParentID as the dictionary key, and the dictionary value a...

Why it's so slow when a wcf client connects to the service?

Hi All, I met a performance issue when using the WCF service. Here's the story: I wrote a self-hosted WCF service which is hosted by a console application; I wrote a simple client to consume the service; After the WCF service is running, it takes over 15 seconds for the client to create connection with the service. The WCF service ...

glib memory allocation VS std *alloc and free

I tend to use std *alloc/free functions to allocate/free dynamic memory in my C programs. I wonder if there are any good reasons to use the GLIB Memory Allocation functions instead of the std ones. I'd be grateful if the comunity could point out situations where either of these solutions is a winner/looser. I am also interested in perf...

sharepoint hardware recommendation for public sites

Hi We have built 2 web sites on MOSS 2007 which have many customizations on pages and many ajax web parts. Currently one of the sites is live and the configuration is as follows Web server Xeon 4 core processor 12 GB RAM 50 GB harddisk SQL Server Xeon 4 core processor 16 GB RAM 150 GB disk space Servers are deployed as virtual ma...

TSql, building indexes before or after data input

Performance question about indexing large amounts of data. I have a large table (~30 million rows), with 4 of the columns indexed to allow for fast searching. Currently I set the indexs (indices?) up, then import my data. This takes roughly 4 hours, depending on the speed of the db server. Would it be quicker/more efficient to import the...

Which costs more while looping; assignment or an if-statement?

Consider the following 2 scenarios: boolean b = false; int i = 0; while(i++ < 5) { b = true; } OR boolean b = false; int i = 0; while(i++ < 5) { if(!b) { b = true; } } Which is more "costly" to do? If the answer depends on used language/compiler, please provide. My main programming language is Java. Please do n...

Dispatch requests to other servers based on API key

I am designing an app that requires that all requests to our servers be routed through a single 'dispatcher'-type server. This server will, based on an API key sent in the request, forward the request on to an appropriate backend server, than relay the response back to the client. eg., an incoming request could be http://example.com:657...