performance

For vs Foreach loop in C#

Hi , Can you tell me which code snippet will give better perfomance? The below code segment has wriiten by C#. 1) for(int tempCount=0;tempCount<list.count;tempcount++) { if(list[tempCount].value==value) { // some coding } } 2) foreach(object row in list) { if(row.value==value) { //some coding } } ...

Problem: Failed to load perf counters from the computer <comp name> | help please.

I am using the Web Application Stress tools from Microsoft to run some stress tests on a Windows 2003 IIS 6 server. I am running the WAS tool from a windows XP machine. I have been following this tutorial and when trying to add perf counters I get the following error : Failed to load the perf counters from the computer \mycomp D...

simple sql query

which one is faster select * from parents p inner join children c on p.id = c.pid where p.x = 2 OR select * from (select * from parents where p.x = 2) p inner join children c on p.id = c.pid where p.x = 2 ...

Performance of Empty Functions in PHP

What are the 'costs' involved in calling an empty PHP function? The main purpose is for a CMS to trigger included module events at various points in its lifespan to handle things like security, access permissions, post processing, timing, http(s) and the like. Since there can be over a dozen modules called dozens of times each the tota...

Improving performance and speed of Watin

We're using Watin for acceptance tests and we find it gets mighty slow once we have Web pages that are more than 100K of HTML source. I've a feeling that some of the speed issues come from iterating over HTML tables. Some of our tables have 50 - 60 rows, each with 5 - 10 columns, and this makes Watin quite slow when searching for items...

Profiling CPU usage of ASP.NET web app - but not the database!

I'm seeing consistently high CPU usage for my ASP.NET web application (on the live production box only, naturally....!) and I'm trying to narrow down the cause - it's basically maxing out a quad core Xeon box and there's no way it should be able to do that! The CPU usage of the web process is generally higher than that of the DB proces...

slow update (primary key)

update auditdata set TATCallType='12',TATCallUnit='1' from auditdata auditdata inner join Auditdata_sms_12 a_sns on auditdata.ID = a_sns.id when I above query it takes more than 10 minutes to execute. what wrong in this Auditdata.ID is primary key.. if i run Update command is that also update the indexes??? is this reason...

improving performance of writing query results to CSV in java

Hello all, I have the following code that executes a query and writes it directly to a string buffer which then dumps it to a CSV file. I will need to write large amount of records (maximum to a million). This works for a million records it takes about half an hour for a file that is around 200mb! which seems to me like a lot of time, n...

Database Permission Structure

Many of my employers applications share a similar internal permission structure for restricting data to a specific set of users or groups. Groups can also be nested. The problem we're currently facing with this approach is that enumerating the permissions is incredibly slow. The current method uses a stored procedure with many cursors a...

How can I speed up instantiating a large collection of objects?

The code below is extremely slow for tables of any significant size. (100, 1000, etc...) The culprit is instantiating my objects with new T(). Note that this isn't my finalized code, I've just broken parts of it out in order to more easily profile. Instantiation and initialization will happen together once I refactor the code back int...

Php Imageresize Performance Question

I'm working on an image resize script for php, and had a few questions.. Currently I'm pulling an external URL as the image, and don't really want to store the new image that is going to be re-sized on my server. Here is what I'm trying to do: Have the script resize the image, than encode it the resized image in base64 on the fly. No...

Running test on Production Code/Server

I'm relatively inexperienced when it comes to Unit Testing/Automated Testing, so pardon the question if it doesn't make any sense. The current code base I'm working on is so tightly coupled that I'll need to refactor most of the code before ever being able to run unit tests on it, so I read some posts and discovered Selenium, which I th...

Is a JOIN faster than a WHERE ?

Suppose I have two tables that are linked (one has a foreign key to the other) : CREATE TABLE Document ( Id INT PRIMARY KEY, Name VARCHAR 255 ) CREATE TABLE DocumentStats ( Id INT PRIMARY KEY, DocumentId INT, -- this is a foreign key to table Document NbViews INT ) I know, this is not the smartest way of doing things, but t...

Oracle performance and memory

Hi, I have two queries, and I want to understand which is better in terms of performance and memory. I also welcome other alternatives for these two. Query 1: SELECT DISTINCT a.no, a.id1 , a.id2 FROM tbl_b b , tbl_a a , tbl_c c , tbl_d d WHERE ( b.id1 ...

Which counters should I use in Windows Performance Monitor when logging performance during stress testing of a web app?

I am setting up windows performance monitor to log activity on a web server while running MS Web application stress tool. Which counters should I choose to give me the best picture of where I have bottlenecks, slow performance and response etc? cheers ...

.Net Application performance monitoring tool

is there any .Net Application performance monitoring tool? I've an application in C#.net stand alone application. I've to look at the performance of that application. Performance in the sense memory,CPU usage and loading etc... ...

C#: How to implement a smart cache

I have some places where implementing some sort of cache might be useful. For example in cases of doing resource lookups based on custom strings, finding names of properties using reflection, or to have only one PropertyChangedEventArgs per property name. A simple example of the last one: public static class Cache { private static ...

Performance issue with site speed 'w3p.exe’ process –reaches 99/100%

My site goes slow and stops access certain services externally if we check the Process monitor we see that it is normally due to the ‘w3p.exe’ process – which is the background process for running the website – it regularly reaches 99/100% - killing the process/restarting the WebPublishing service reolves tis – my webhost says this can o...

Are ASP.NET Web Site projects inherently slow at compiling, or could I have deeper issues?

Hi, I've been working on a legacy ASP.NET Web Site (versus a Web Application) project at a client for some time now, and its slow compile time has me wondering: Are web site projects known to be slow(er) at compiling (than Web Application projects)? It's a pretty small website, but the entire solution has tons of functionality -- 19 p...

jQuery drag drop slower for more DIV items

Hi there, I have got a hierarchichal tags (with parent child relationship) in my page and it will account to 500 - 4500 (can even grow). When i bound the draggable and droppable for all i saw very bad performance in IE7 and IE6. The custom helper wont move smoothly and was very very slow. Based on some other post i have made the dro...