performance

What is the most efficient way to store a mapping "key -> event stream"?

Suppose there are ~10,000's of keys, where each key corresponds to a stream of events. I'd like to support the following operations: push(key, timestamp, event) - pushes event to the event queue for key, marked with the given timestamp. It is guaranteed that event timestamps for a particular key are pushed in sorted or almost sorted or...

Small and fast .NET programs? - 65% runtime in ResolvePolicy

Hi, I tried to build a very very small .NET app in F#. It just has to convert a small string into another string and print the result to the console like: convert.exe myString ==> prints something like "myConvertedString" I used dottrace to analyze the performance: 26% (168ms) in my actual string conversion (I thinks this is ok.) ...

Speeding up PostgreSQL query where data is between two dates

I have a large table (> 50m rows) which has some data with an ID and timestamp: id, timestamp, data1, ..., dataN ...with a multi-column index on (id, timestamp). I need to query the table to select all rows with a certain ID where the timestamp is between two dates, which I am currently doing using: SELECT * FROM mytable WHERE id = ...

MySQL load data infile - acceleration?

Hi folks, sometimes, I have to re-import data for a project, thus reading about 3.6 million rows into a MySQL table (currently InnoDB, but I am actually not really limited to this engine). "Load data infile..." has proved to be the fastest solution, however it has a tradeoff: - when importing without keys, the import itself takes about ...

How to optimize this code

Hi I class Car it has a property: string Code and 10 other. common codes is list of strings(string[] ) cars a list of cars(Car[]) filteredListOfCars is List. for (int index = 0; index < cars.Length; index++) { Car car = cars[index]; if (commonCodes.Contains(car.Code)) { filteredListOfCars.Add(car); } } Unfort...

Is this slow WPF TextBlock performance expected?

Hi, I am doing some benchmarking to determine if I can use WPF for a new product. However, early performance results are disappointing. I made a quick app that uses data binding to display a bunch of random text inside of a list box every 100 ms and it was eating up ~15% CPU. So I made another quick app that skipped the data binding/...

What performance indicators can I use to convince management that I need my development PC upgraded?

At work, my PC is slow. I feel that I can be way more productive if I just wasn't waiting for Visual Studio and everything else to respond. My PC isn't bad (dual-core, 3GB of RAM), but there is a lot of corporate software and whatnot to slow everything down and sometimes lock it up. Now, some developers have begun getting Windows 7 mach...

web drop-down combo box with large list of records

The amount of records to be displayed in drop-down combo boxes affect the performance of internet applications. What are the current best practices to solve this problem? Are paginated drop-downs the only solution? What is considered a large list? >100 or > 1000? ...

What is the correct stage to use for Google Guice in production in an application server?

It seems like a strange question (the obvious answer would Production, duh), but if you read the java docs: /** * We want fast startup times at the expense of runtime performance and some up front error * checking. */ DEVELOPMENT, /** * We want to catch errors as early as possible and take performance hits up front. */ PRODUCTION...

How do you optimize database performance when providing results for autocomplete/iterative search?

Note: In this question I'm using the term "autocomplete" (or "iterative search") to refer to returning search-as-you-type results, e.g. like Google Search gives you. Also my question is not specific to web applications vs. fat client apps. How are SQL SELECT queries normally constructed to provide decent performance for this type of...

C# performance analysis- how to count CPU cycles?

Is this a valid way to do performance analysis? I want to get nanosecond accuracy and determine the performance of typecasting: class PerformanceTest { static double last = 0.0; static List<object> numericGenericData = new List<object>(); static List<double> numericTypedData = new List<double>(); static void Main(string...

Slow query with unexpected index scan

Hello I have this query: SELECT * FROM sample INNER JOIN test ON sample.sample_number = test.sample_number INNER JOIN result ON test.test_number = result.test_number WHERE sampled_date BETWEEN '2010-03-17 09:00' AND '2010-03-17 12:00' the biggest table here is RESULT, contains 11.1M records. The left 2 tables about 1M. this...

Poor Ruby on Rails performance when using nested :include

I have three models that look something like this: class Bucket < ActiveRecord::Base has_many :entries end class Entry < ActiveRecord::Base belongs_to :submission belongs_to :bucket end class Submission < ActiveRecord::Base has_many :entries belongs_to :user end class User < ActiveRecord::Base has_many :submissions end ...

Memory Bandwidth Performance for Modern Machines

I'm designing a real-time system that occasionally has to duplicate a large amount of memory. The memory consists of non-tiny regions, so I expect the copying performance will be fairly close to the maximum bandwidth the relevant components (CPU, RAM, MB) can do. This led me to wonder what kind of raw memory bandwidth modern commodity ma...

A solution for the slow diff in (Tortoise)SVN?

I often do code review in the following way: Open the SVN log Select a revision Double click on a file... ...and wait See the changes Goto 2 or 3 or finish The 4th step is very annoying. Do you know a solution for this? ...

mysql subquery strangely slow

I have a query to select from another sub-query select. While the two queries look almost the same the second query (in this sample) runs much slower: SELECT user.id ,user.first_name -- user.* FROM user WHERE user.id IN (SELECT ref_id FROM education WHERE ref_type='user' ...

A question about the performance of htmlText in TextField

Hi all, I have got a performance problem about TextField.htmlText +=msg.And I know thatTextField.appendText(msg) works better than TextField.text +=msg.So I wonder if there's some method better than TextField.htmlText +=msg?Any help would be appreciated. Regards Spawn ...

High performance web (-services) applications

Hi, I'd like to become a guru in high performance (100k and more views/requests) web & web-services applications. What technologies/patterns/skills do you reccomend to look at? Basically, I have good skills at ASP.NET/.NET based web development, but I'd like to know how big things are built (on any platform, not depending on .net technol...

CakePHP - Set recursive to -1 in AppModel then use Containable behaviour as appropriate

When using CakePhp would it be advisable to set recursive = -1 in the AppModel class and then use the Containable Behaviour whenever you need a deeper data relationship? I believe this would give my applications the best chance of avoiding database related sluggish performance but is the methodology sound? Thanks Leo ...

datagridview perfomance loading data

Hi, I've got collection of 50k records, and i get it in one second, but loading it to database take about 10 secunds. How to increase loading data? Everything what i make now is: dgvCars.DataSource=cars; ...