performance

C# 'ref' keyword, performance.

If you have a Bitmap object that needs to be passed to numerous methods (about 10), and finally to an event where it shall finally be disposed of after its used, would it be (performance wise) beneficial to pass it to every one of those methods by reference instead of value? Passing by value the object is copied, passing by reference its...

C# HTTPWebResponse + StreamReader Very Slow!!!

Hi all. I'm trying to implement a limited web crawler in C# (for a few hundred sites only) using HttpWebResponse.GetResponse() and Streamreader.ReadToEnd() , also tried using StreamReader.Read() and a loop to build my HTML string. I'm only downloading pages which are about 5-10K. It's all very slow! For example, the average GetRespons...

Advantages and Disadvantages of using MVC Design Pattern (Model View Controller)

I am at the point in my design where I am contemplating dropping the MVC design for performance reasons, not sure if straight out PHP pages with header/footer includes would out perform my MVC setup (using PHP/Zend). I have a feeling it would. Comments? ...

Indexing a 'non guessable' key for quick retrieval?

I'm not fully getting all i want from Google analytics so I'm making my own simple tracking system to fill in some of the gaps. I have a session key that I send to the client as a cookie. This is a GUID. I also have a surrogate IDENTITY int column. I will frequently have to access the session row to make updates to it during the life o...

Log all requests to web site in database

I need to log all post and get requests on web site in the database. There will be two tables: requests with time stamp, user id and requested URI request parameters with name, value and request id I will use it only for analytical reports once per month. No regular usage of this data. I have about one million requests a day and th...

Java foreach efficiency

I have something like this: Map<String, String> myMap = ...; for(String key : myMap.keySet()) { System.out.println(key); System.out.println(myMap.get(key)); } So is myMap.keySet() called once in the foreach loop? I think it is, but want your opinion. I would like to know if using foreach in this way (myMap.keySet()) has a pe...

Java Exceptions Loops and Deprecation (or is it a URLEncoding thing?)

I just wrote a whole blurb on how I reached this point, but figured it's easier to post the code and leave it at that :) As far as I can tell, the performance of test3() should be the same as test1() - the only difference is where the exception is caught (inside the calling method for test1(), inside the called method for test3()) Why ...

SQL Server 2005 and Full Text Search Performance problem

Dear All, I have a heavy table on sql server 2005 with enable full text search on it, I want to get top N newest data by id or insert date with specific full text. some query result with "Containstable" return over 500,000 record and take over 1 min, that is very bad, also top n by rank not good for me because maybe return old data ...

RLS Cost Function - Slow Computation MATLAB

Dear, I creat a simulation adaptive noise cancellation using RLS algorithm, I use matlab 7.6 toolbox (adaptfilt.rls) to perform adaptive filtering, This is the matlab m file that I made, i modify the matlab m file located on "C:\Program Files\MATLAB\R2008a\toolbox\filterdesign\filterdesign\@adaptfilt\@rls\thisfilter.m", by adding the ca...

Is binding events in jQuery very expensive, or very inexpensive?

I just wrote a $().bind('event') function and then got concerned that this kind of a call might be very expensive if jQuery has to run through each element in the DOM to bind this event. Or maybe, it's just about as efficient as an event could be. The jQuery docs I've read aren't making this clear. Any opinions? ...

Measure size of Web Requests and Responses

I am looking for a way to measure the size of web requests and responses that I make in my browser. I would need a way to measure regular requests, as well as ajax requests. I am trying to improve Ajax performance by decreasing request and response size, and I need some way to benchmark this on the client end as well as measure my progre...

What caused a Private Bytes on SQL Server 2005?

My Server is Windows 2003 and SQL Server 2005 Standard. 3 GB of RAM. After run my client program for a while a Private Bytes up to 1.7 GB and never come down. only process 51 with status "runnable". Click details. create table #tmpDBCCinputbuffer ( [Event Type] nvarchar(512), [Parameters] int, [EventInfo] nvarchar(512)) insert into #...

ssrs 2008 TimeDataRetrieval timings

I've a report whith an odd performance issue. When running it under the following conditions, SSRS Server (UAT_SSRS) & SQL Server (SERVER_SQL) I'm getting a TimeDataRetrieval value of 23726. When I run it under a different SSRS server (PROD_SSRS) and still use the same SQL server (SERVER_SQL) the value for is 325952 (well over TEN TIME...

SQL Server Performance and clustered index values

I have a table myTable with a unique clustered index myId with fill factor 100% Its an integer, starting at zero (but its not an identity column for the table) I need to add a new type of row to the table. It might be nice if I could distinguish these rows by using negative values of myId. Would having negative values incur extra page s...

C++ code performance

Hi there When is about writing code into C++ using VS2005, how can you measure the performance of your code? Is any default tool in VS for that? Can I know which function or class slow down my application? Are other external tools which can be integrated into VS in order to measure the gaps in my code? ...

selecting and displaying ranked items and a user's votes, a la reddit, digg, et al

when selecting ranked objects from a database (eg, articles users have voted on), what is the best way to show: the current page of items the user's rating, per item (if they've voted) rough schema: articles: id, title, content, ... user: id, username, ... votes: id, user_id, article_id, vote_value is it better/ideal to: select ...

Optimizing Lookups: Dictionary key lookups vs. Array index lookups

I'm writing a 7 card poker hand evaluator as one of my pet projects. While trying to optimize its speed (I like the challenge), I was shocked to find that the performance of Dictionary key lookups was quite slow compared to array index lookups. For example, I ran this sample code that enumerates over all 52 choose 7 = 133,784,560 possib...

Generating random couples in C#

I have a table in my DB with a list of people. I need to create a list of random buddies every day. The idea is that every day every person is paired with a differenct random person for that day. Since the table may get very large I was wondering what would be the best way to do such a thing? I have thought of 2 ideas but I am not so ...

Writing clean, performant code for the iPhone

I have been developing on the iPhone with Objective-C for a few months now and I have been applying the best-practices learnt and refined while developing applications with Java. These include: designing classes that have a single responsibility, application of design patterns where appropriate, and writing short methods that do one thin...

IIS 6.0 Server Too Busy HTTP 503 Connection_Dropped DefaultAppPool

We have a site which is running on a windows 2003 cluster with 2 64bit machines. The site needs to be able to cope with over 20,000 concurrent users One of the things that the site does is to allow the download of a 2MB file (which is cached in memory). We have low CPU and memory usage. We also have surplus bandwidth. It appears that...