performance

Please Advise on Performance in C# File Encryption

I have created a test (not real) encryption function which takes a byte[] and replaces all the bytes with 0xff and returns private byte[] encrypt(byte[] input) { for (int i = 0; i < input.Length; i++) { input[i] = 0xff; } return input; } Now i want ...

Should a function be used in try block that has to be executed in finally block.

try { OpenConnection(); RowsAffected = cmd.ExecuteNonQuery(); CloseConnection(true); //should I use this function call here //as well, when I am using it in finally //block. For closing database connection. } catch (SqlException ex) { throw ex; } finally { CloseConnection(true); } Or Should I write it this way try { Ope...

Django - Selecting related set : how many times does it hit the database ?

I took this sample code here : http://stackoverflow.com/questions/853184/django-orm-selecting-related-set polls = Poll.objects.filter(category='foo') choices = Choice.objects.filter(poll__in=polls) My question is very simple : do you hit twice the database when you finally use the queryset choices ? ...

Why with PHP hundreds of DB connections dont matter..but in C++ app they do?

In most web (PHP) apps, there is mysql_connect and some DB actions which means that if 1000 users is connected, 1000 connections are opened? But with C++ app it is incredibly slow...what is the main difference? Thanks ...

How to simulate a reboot in Win7 for testing application cold-start time

In order to measure application' cold-start time, I have to reboot my machine every time, which is really time-consuming. I understand it is mission impossible to simulate a real reboot, but what I want is something rough, ex, put out cache in standby list as many as possible so the warm start won't be so warm anymore. Any ideas on this...

which solution to choose for better Performance and why?

Hi; I want to know which language either php an interpreted language or Asp.net a compiled language to be adopted in the following scenario for better performance and why? Scenario: A business to business portal has to be made which will face 10,000+ users per hour traffic. ...

Which NoSQL backend to store trace data from webpage

Hi, In our web application we need to trace what users click, what they write into search box, etc. Lots of data will be sent by AJAX. Generally functionality is a bit similar to google analytics, but we need to customize it in different ways. Data will be collected and once per day aggregated and exported to PostgreSQL, so backend sh...

Hiding Rows Given A Certain Criteria (slow)

I'm trying to hide tr's within a html table if the inputs inside them match a certain criteria. The criteria is defined by a dropdown's selected value. I'm doing it like so: $(function () { $('body').find('#p_Selection').live('change', function () { var type = $('body').find('#p_Selection').attr('value'); var tableRow = $('....

how to add simple security and measure performance of web service

hi, So I'm making a app for a bank, but it doesnt manage very important data. I have two problems, it will run over a VERY large LAN network protected by all kinds of security(antivirus and firewalls) and the bandwidth in certain regions is as low as 56kbps.(Its a desktop app with a web server backend connected by web services) From th...

Is it a good idea to create new XHTML markup for speed and readability reasons?

Hi folks, I develop for a web app startup and I come across the following code quite often. <div class="items container"> <div class="item"> <div class="property propertyA">Some stuff</div> </div> </div> Our typical jQuery selector looks pretty much similar to: $("div.items.container > div.item > div.property.propert...

Query Performance, Multiple "OR's" vs. Separate Statements

Let's say I have an Oracle database table of 40MM 9-digit ZIP codes which includes the 4-digit ZIP code for each. I have a list of 800 5-digit ZIP codes and I need to find all the associated 9-digit ZIP codes. There are 40K 5-digit ZIP codes altogether. Assume we have indexed the 5-digit ZIP code field with a B*Tree (conventional) ind...

Static method calls to derived types over virtual implementations? (Android)

I have class A, with methods foo and bar, that are implemented by A1 and A2. The functionality in both A1 and A2 is the same. In other words: public class A { public int foo() { return 0; }; public int bar() { return 1; }; } class A1 extends A { public int AnotherFooFunction() { return foo(); } ...

Is it normal that performance of “dotted” linestyle is much slower than “dashed” linestyle?

I have an application written in C++ using Qt4.4.3 on Linux. Doing some benchmarking, I create a large number of rectangles and compare the difference of performance of drawing various line styles. The worst performance is the “dotted” line style, the “dashed” line style is much faster. It would seem to me that these should not vary so...

Mysql is taking .7 seconds to "copy into tmp table". What is the best way to cache this kind of query?

I have a group-by query that is very fast when it comes to indexing, joining, sending the results etc. Unfortunately, mysql spends 99.6% of its time "copying to tmp table" when I profile it. I am at a loss as to how I can get mysql to perform better on its own. This group by query essentially finds the number of entities for the top 20 ...

web application testing framework suggestions

Anyone have good experience with a web application testing framework? We are in process of selecting one for our application written in C#, ASP.NET etc., but the framework can be anything (unless, of course, choosing one written in C# helps somehow). The application is distributed. What we would like (ideally) is: Something that will ...

Game engine design with dynamic properties

I am currently developing a C# .net XNA game engine. I had a question about the design of the engine. First of all I would like to have my engine be able to incorporate my own scripting language. To do so I was thinking I would have to be able to access to all the properties of all the objects in the game, or just the ones I would like...

C# delegate performance in xna game

I am currently developing a C# .net xna game engine. I have been trying to figure out a way to have an update manager / scheduler / event system. I currently am using delegates to provide a way to create dynamic scheduled tasks and events. I have recently read that delegates can be slow. The delegates in my game are being invoked every...

GameLoop() vs Delegation - massive prformance boost

Hello, I just finished my first game and just submitted to apple for aproval. Its a simple space shooting game where obsticales come at the player and you shoot them. I used "traditional" approach using the gameloop() which is scheduled 60tps. On the final stages, I tried to implement particle FX and simply was unable to put more then tw...

WPF Performance

I am building a simple photo gallery application which shows images in a listbox. The xaml is: <ListBox x:Name="imageList" Margin="10,10" ItemsSource="{Binding}" Height="500"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding}" Ho...

How does Shingleprinting work in practice?

I'm trying to use shingleprinting to measure document similarity. The process involves the following steps: Create a 5-shingling of the two documents D1, D2 Hash each shingle with a 64-bit hash Pick a random permutation of the numbers from 0 to 2^64-1 and apply to shingle hashes For each document find the smallest of the resulting valu...