performance

Why am I seeing slower performance here from WCF than Remoting?

Everything I'm told says that WCF should be at least as fast as remoting. I have a specific scenario here, however, where it isn't even close, and I'm wondering if someone can spot something obvious that I'm doing wrong. I'm looking into the possibility of replacing remoting with wcf for the in-process intra-appdomain communication heavy...

Is this session provider correct for the web?

Hi, Just learning nhibernate with fluent, and my session provider looks like: public class SessionProvider { private static ISessionFactory sessionFactory; public static ISessionFactory SessionFactory { get { if (sessionFactory == null) { ...

How can I achieve a modulus operation with System.TimeSpan values, without looping?

I'm in a very performance-sensitive portion of my code (C#/WPF), and I need to perform a modulus operation between two System.TimeSpan values in the quickest way possible. This code will be running thousands of times per second, and I would very much prefer to avoid using a manual loop calculation - at all costs. The idea of a modu...

Performane improvement in getting paged data for asp.net grid

I am encountering a performance problem in the development of current UI. The problem, I suppose, is however general. I have a page with a simple asp.net grid. Grid will display data from a table based on certain search criteria. Moreover, grid has fixed page size (say 10). There is pager at the bottom which can be used to navigate b/w...

What happens when Java Compiler sees many String concatenations in one line?

Suppose I have an expression in Java such as: String s = "abc" + methodReturningAString() + "ghi" + anotherMethodReturningAString() + "omn" + "blablabla"; What's the behaviour of the Java's default JDK compiler? Does it just makes the five concatenations or there is a smart performance trick done? ...

Performance Benchmark CouchDB x Relational Databases

Does anyone knows a link for a good performance benchmark of CouchDB x "Any relational Database" ...

jQuery - Scripts slow to apply in IE6: Can anything be done?

The answer is probably no, but in IE6, jQuery is slow to apply the jQueryUI accordion control, meaning the unstyled links behind the accordion are visible for probably a quarter to a half of a second before the accordion styling applies. This is highly distracting, so I went ahead and hid the div and had jQuery unhide it when it loads. ...

Reasons why gzipped content might not be grokked by the browser

I'm attempting to serve static resources (css and javascript) as cached gzipped files for performance reasons. The pages look gzipped when rendered, the Content-Encoding is correctly set to gzip according to LiveHTTPHeaders, and most importantly, the gzipped content is passing the GIDZipTest page (http://www.gidnetwork.com/tools/gzip-te...

Simple MySQL Query Taking 2 to 3 seconds?

I have a fairly simple process running that periodically pulls RSS feeds and updates articles in a MySQL database. The articles table is filled to about 130k rows right now. For each article found, the processor checks to see if the article already exists. These queries almost always take 300 milliseconds, and about every 10 or 20 tries...

How to set initial size for a dictionary in Python?

I'm putting around 4 millions different keys into a python dictionary. Creating this dictionary takes about 15 minutes and consumes about 4GB memory on my machine. After dictionary is fully created, queering the dictionary is fast. I suspect that dictionary creation is so resource consuming as the dictionary is very often rehashed (as i...

Manually select related table data (SELECT N + 1 problem) LINQ to SQL

Database example: Image - ImageTag - Tag Images can have multiple tags. The relationships are set up fine and stuff but I am running into performance issues. I have many different queries which select Images according to different criteria. They work fine, however the data for the Tags are not selected with these queries. This means ...

Which of these selectors is likely to be faster?

A couple of questions actually, Given that the following two will return the same result set $("#MyTable tr"); $("tr", "#MyTable"); is there any difference in performance between using the Parent-Child CSS selector convention or specifying a context to the selector instead? Also, given that I can guarantee a tr will be an immediate ...

MySQL slow query in rare cases even though index is being used

Hi, I have a query in a large MySQL table (>4 million rows). This query is used in a stored procedure and it searches by surname and another numeric field. When I use different combinations of these search parameters, I get quick results (between 1 and 2s) but with some particular values, I get a query which takes 9s to return results o...

ASP.Net Stress Testing Actual Use of Application

I have read a few questions here about stress testing and people commonly recommend ab selenium jmeter openSTA but these all seem based around Apache and Java and Scripting etc. Selenium seems the best option because you record the actual use of you site which simulates UI load and database requests etc and then play it over an...

CPU consumption equivalent for harddisk scanning.

I would like my software that scans disk structure to work in background but lowing the priority for the thread that that scans disk structure doesn't work. I mean you still have the feeling of the computer hard working and even freezing even if your program consumes only 1 percent of the processor time. Is it possible to implement "hard...

Are Windows Workflow Foundation Statemachines suitable for high performance scenarios?

hi there, i´m currently dealing with a system where i have to track the state for several thousand objects in parallel that send possible state updates a few times every minute. In addition i have to perform additional computation (no slow IO stuff, just using CPU). I currently use a custom state machine implementation. however, as WF ...

How to tell if OpenMP works in my C++ program

Hi, I am using OpenMP to do multithreading with my nested loops. Since new to this stuff, I am not sure if I am using OpenMP in the correct way so that it can actually do the parallel programming. So I like to know if I can measure the performance of my C++ program that uses OpenMP so I can tell it actually works and I am on the right tr...

Uploading files in WCF services approaches

I have WCF service that I can upload files. XElement upload = service.UploadFiles(id, File.ReadAllBytes(filePath)); This works, but I am just wondering if it is the best way to upload each of them one by one when you have many (about a thousand) small files (15~20K). How can we compare "Chunky" versus "Chatty" approaches? 1) Is it be...

Update rows in a table with many columns

I have a table (several actually) that contain a lot of columns (maybe 100+). What's best performance-wise when updating rows in the table, if only a few columns have been changed. To build the UPDATE statement dynamically only updating the changed columns. To build a parameterized UPDATE-statement containing all columns, including tho...

Which is faster in a loop: calling a property twice, or storing the property once?

This is more of an academic question about performance than a realistic 'what should I use' but I'm curious as I don't dabble much in IL at all to see what's constructed and I don't have a large dataset on hand to profile against. So which is faster: List<myObject> objs = SomeHowGetList(); List<string> strings = new List<string>(); for...