performance

C# *Strange* problem with StopWatch and a foreach loop

I have the this code: var options = GetOptions(From, Value, SelectedValue); var stopWatch = System.Diagnostics.Stopwatch.StartNew(); foreach (Option option in options) { stringBuilder.Append("<option"); stringBuilder.Append(" value=\""); stringBuilder.Append(option.Value); stringBuilder.Append("\""); if (opti...

ROW_NUMBER() OVER Not Fast Enough With Large Result Set, any good solution?

I use ROW_NUMBER() to do paging with my website content and when you hit the last page it timeout because the SQL Server takes too long to complete the search. There's already an article concerning this problem but seems no perfect solution yet. http://weblogs.asp.net/eporter/archive/2006/10/17/ROW5F00NUMBER28002900-OVER-Not-Fast-Enoug...

best practice for loading necessary JSON data: jquery's $(document).ready() hook? in the <HEAD> of page?

Hi everyone, I have been reading Yahoo's Best Practices For Speeding Up Your Website, but still have a question that I could really use your help with: The very first page of my web app needs to display a bunch of data that is dependent on the city the user is in. On the first visit, the user is prompted to pick her city and I store ...

Performance of C++ Operators

Is there any sort of performance difference between the arithmetic operators in c++, or do they all run equally fast? E.g. is "++" faster than "+=1"? What about "+=10000"? Does it make a significant difference if the numbers are floats instead of integers? Does "*" take appreciably longer than "+"? I tried performing 1 billion each of "...

Memory vs. Performance

Hello, This has always been on my mind while programming, so i thought i'd spit it out before it actually gets to me. What should i be more worried about? The memory the application consumes, or the performance it takes. By this i mean should i be focused upon using less memory for of the application and using more performance (eg. loa...

Static methods in C#?

What is the performance concern with static method over non-static methods? I have read that Static methods are better in terms of performance but i want to know, how they are faster? If a method is not using any instance member then our compiler should take care of it and treat it as static method. ...

Can AJAX slow down because of virus scanners or active network filtering?

I just heard one of the clients having really bad performance on IE6 despite modern hardware and decent network connection. So we are suspecting either one or both to be the reason for the bad performance. Unfortunately no exact details of firewalls or such known at the moment... What kind of issues you have had with web applications us...

JavaScript: Sluggishness events? Google Chrome "Speed Tracer" extension is reporting

Using Google Chromes new Speed Tracer extension to profile my app. Appears my app is constantly reporting "Sluggish (events) 100%", which means the browser is blocking html rendering. I don't understand enough how to interpreter the Speed Tracer tool to fix this issue. Any help appreciated. My web app is: bit.ly/7J0U ...

How to build a server that accepts many thousands of persistent network connections?

I am about build a server on linux (I get to pick programming language) that accepts many TCP/IP socket persistent connections from a desktop software. How can this be done cheaply and efficiently? A machine cannot have more than 60000 ports, so if I have to support 600k connections then I will need 10 linux boxes? Since the computatio...

Performance penalty of getSerializedSize() in Protocol Buffers

Is there a performance penalty for calling getSerializedSize() on a GPB message before serializing the message with writeTo(OutputStream)? I need to be able to know the size of a message before writing it to an output stream. I'm using GPB on Java. ...

PHP how to run sql query one part at a time?

I have a table with roughly 1 million rows. I'm doing a simple program that prints out one field from each row. However, when I started using mysql_pconnect and mysql_query the query would take a long time, I am assuming the query needs to finish before I can print out even the first row. Is there a way to process the data a bit at a tim...

SQL Server Latches and their indication of performance issues

I am trying to understand a potential performance issue with our database (SQL 2008) and in particular one performance counter, SQLServer:Latches\Total Latch Wait Time Total Latch Wait Time (ms). We are seeing a slow down in DB response times and the only correlating spike that I can match it with is a spike in Total Latch Wait Time and ...

DirectoryServices.AccountManagement - group membership checking efficiency

We have a group in Active Directory with over 70k user accounts. I need to check whether someone is a member of that group. The code is going to run in a web app with a high volume of concurrent users. I'd prefer to stick to System.DirectoryServices.AccountManagement if possible to reduce the amount of code that's written for this app. ...

is there a profiling gem/plugin for Ruby on Rails?

Hi, is there a profiling gem/plugin for Ruby on Rails? That is, where I can then specify the point in a request I want to act as milestones points for a time to be taken, and place them stategically. Then ideally the plugin then works out and displays how the overall response time was made up... Tks ...

Which PHP framework to choose for a big project? Help me to choose.

Possible Duplicate: What PHP framework would you choose for a new application and why? Hello! I'm going to create a serious web project. Until this time, I've been developing projects with Drupal, but I want to switch to a PHP framework. Which framework can you suggest and why? Scalability and performance are must. I was playin...

what does O(N) mean

Possible Duplicate: What is Big O notation? Do you use it? Hi all, fairly basic scalability notation question. I recently recieved a comment on a post that my python ordered-list implimentation "but beware that your 'ordered set' implementation is O(N) for insertions" Which is great to know, but I'm not sure what this means. ...

How can I compare the performance of PHP to Perl?

Although both are interpreted languages there are differences or? What are the performance differences of both languages? Even if Perl would be faster than PHP, the most would choose PHP, because of the simplicity of PHP. Does someone have experience in this regard? ...

How long does it take to wipe 1 GB of memory?

Today we were discussing how long Garbage Collection breaks needs. And were wondering how long it would take to simply wipe 1 Gigabyte of memory. What would it take? ...

WPF Can you clear video memory?

I have a very rich media based application built in WPF, and Im using lots and lots of different PNG images to add animations and materials to 3D objects, as well as 2D animations. I have noticed that quickly the video memory fills up, and Im looking into trying to clear it. I don't seem to be able to do anything through C# to force th...

Ruby on Rails question - how can I measure response time from when request first hits app?? (e.g. using 'benchmark')

Hi, Background - I'm serving files (text, images) to a browser via my Rails application as the user needs to be authenticated too. The files are on file system, however references are in the database, as I'm using PAPERCLIP. Using AUTHLOGIC for authentication. I'm finding the response times are quite bad, as each request for HTML/ima...