performance

Which PHP opcode cacher should I use to improve performance?

I'm trying to improve performance under high load and would like to implement opcode caching. Which of the following should I use? APC - Installation Guide eAccelerator - Installation Guide XCache - Installation Guide I'm also open to any other alternatives that have slipped under my radar. Currently running on a stock Debian Etch w...

Why does SQL Server work faster when you index a table after filling it?

I have a sproc that puts 750K records into a temp table through a query as one of its first actions. If I create indexes on the temp table before filling it, the item takes about twice as long to run compared to when I index after filling the table. (The index is an integer in a single column, the table being indexed is just two column...

Linq To SQL: Can I eager load only one field in a joined table?

I have one table "orders" with a foreing key "ProductID". I want to show the orders in a grid with the product name, without LazyLoad for better performance, but I if use DataLoadOptions it retrieves all Product fields, which seams like a overkill. Is there a way to retrieve only the Product name in the first query? Can I set some attr...

Why is pagination so resource-expensive?

It's one of those things that seems to have an odd curve where the more I think about it, the more it makes sense. To a certain extent, of course. And then it doesn't make sense to me at all. Care to enlighten me? ...

C# Performance For Proxy Server (vs C++)

I want to create a simple http proxy server that does some very basic processing on the http headers (i.e. if header x == y, do z). The server may need to support hundreds of users. I can write the server in C# (pretty easy) or c++ (much harder). However, would a C# version have as good of performance as a C++ version? If not, would ...

Performance vs Readability

Reading this question I found this as (note the quotation marks) "code" to solve the problem (that's perl by the way). 100,{)..3%!'Fizz'*\5%!'Buzz'*+\or}%n* Obviously this is an intellectual example without real (I hope to never see that in real code in my life) implications but, when you have to make the choice, when do you sacrific...

Fastest way to calculate primes in C#?

I actually have an answer to my question but it is not parallelized so I am interested in ways to improve the algorithm. Anyway it might be useful as-is for some people. int Until = 20000000; BitArray PrimeBits = new BitArray(Until, true); /* * Sieve of Eratosthenes * PrimeBits is a simple BitArray where all bit is an integer * and ...

Using Virtual PC for Web Development with Oracle

Hi, Is anyone using Virtual PC to maintain multiple large .NET 1.1 and 2.0 websites? Are there any lessons learned? I used Virtual PC recently with a small WinForms app and it worked great, but then everything works great with WinForms. ASP.NET development hogs way more resources, requires IIS to be running, requires a ridiculously l...

Is there a reason to use BufferedReader over InputStreamReader when reading all characters?

I currently use the following function to do a simple HTTP GET. public static String download(String url) throws java.io.IOException { java.io.InputStream s = null; java.io.InputStreamReader r = null; //java.io.BufferedReader b = null; StringBuilder content = new StringBuilder(); try { s = (java.io.InputStrea...

Algorithmic complexity of XML parsers/validators

I need to know how the performance of different XML tools (parsers, validators, XPath expression evaluators, etc) is affected by the size and complexity of the input document. Are there resources out there that document how CPU time and memory usage are affected by... well, what? Document size in bytes? Number of nodes? And is the relati...

.Net 2.0 - How efficient are Generic Lists?

I'm creating an app that holds loads of loads of user data in memory, and it's mostly keeping it all in List<T> structures (and some Dictionary<T,T> when I need lookup). And I'm wondering... How efficient are Lists? How much memory overhead do I get for each of them? (that is, memory space in addition to what the objects they contain w...

Any way to write a Windows .bat file to kill processes?

So every time I turn on my company owned development machine I have to kill 10+ processes using the task manager or any other process management app just to get decent performance out of my IDE. Yes, these are processes from programs that my company installs on my machine for security and compliance. What I'd like to do is have a .bat f...

Find out how much memory is being used by an object in Python

How would you go about finding out how much memory is being used by an object in python? I know it is possible to find out how much is used by a block of code, but not by an instantiated object anytime in its life, which is what I want. EDIT: decided to go with the stats that task manager gives me. Based on the strong evidence that wha...

Performance difference between dot notation versus method call in Objective-C

You can use a standard dot notation or a method call in Objective-C to access a property of an object in Objective-C. myObject.property = YES; or [myObject setProperty:YES]; Is there a difference in performance (in terms of accessing the property)? Is it just a matter of preference in terms of coding style? ...

SQL Server - Does column order matter?

In terms of performance and optimizations: When constructing a table in SQL Server, does it matter what order I put the columns in? Does it matter if my primary key is the first column? When constructing a multi-field index, does it matter if the columns are adjacent? Using ALTER TABLE syntax, is it possible to specify in what position...

What is the fastest way to swap values in C?

I want to swap two integers, and I want to know which of these two implementations will be faster: The obvious way with a temp variable: void swap(int* a, int* b) { int temp = *a; *a = *b; *b = temp; } Or the xor version that I'm sure most people have seen: void swap(int* a, int* b) { *a ^= *b; *b ^= *a; *a ^=...

What is the best way to interpret Perfmon analysis into application specific observations/data?

Many of us have used Perfmon tool to do performance analysis. Especially with .Net counters, but there are so many variables going on in Perfmon, that it always becomes hard to interpret Perfmon results in to valuable feedback about my application. I want to use perfmon, (not a tool like Ants Profiler etc) but how do I accurately interpr...

How to test java application for performance bottlenecks?

I am reviewing a big java application to see if there are any performance bottlenecks. The real problem is that I cannot pinpoint the performance issues to any single module. The whole application is slow as such. Is there some tool/technique I can use to help me out in this? ...

IronRuby performance?

While I know IronRuby isn't quite ready for the world to use it, I was wondering if anyone here tried it and tested how well it faired against the other Rubies out there in terms of raw performance? If so, what are the results, and how did you go about measuring the performance (which benchmarks etc)? Edit: The IronRuby team maintains ...

Finding all messages with a given PR_SEARCH_KEY

I need to query an Exchange server to find all messages having a certain value in PR_SEARCH_KEY. Do I have to open every mailbox and iterate through it or is there a faster solution? Edit: This is for a program that needs to prepend something to the subject line of all copies of a message I got through a journal mailbox. ...