performance

SQL Timeout and indices

Changing and finding stuff in a database containing a few dozen tables with around half a million rows in the big ones I'm running into timeouts quite often. Some of these timeouts I don't understand. For example I got this table: CREATE TABLE dbo.[VPI_APO] ( [Key] bigint IDENTITY(1,1) NOT NULL CONSTRAINT [PK_VPI_APO] PRIMARY KEY, ...

How to sum effectively

Before I start, I apologize for a bad title but I could not come up with one that describes my question in a satisfying way. If you come up with a better title, I will gladly switch. Suppose I have an Account model and a Transaction model, and I would like to implement a Account#days_since_balance_was_atleast method, taking a sum as its...

High performance RSA implementation for C# or C

Hi! I have an webservice that performs many RSA-signature operations. I use the CryptograhyProvider from .net. This uses the unmanaged CyptoAPI from Windows. I often have this error: System.Security.Cryptography.CryptographicException: Der RPC-Server ist für diesen Vorgang zu stark ausgelastet. [=The rpc server is too busy to complet...

Are tail-recursive functions ALWAYS to be avoided?

If I recall correctly, tail recursive functions always have an easy non-recursive equivalent. Since recursion involves unnecessary function call overhead, it's better to do it the non-recursive way. Is this assumption always true? Are there any other arguments for/against tail-recursion? ...

Java Loops Optimization

Give the following (straight-forward) code: public class pr1 { public static void f1(){ long sx = 0, s; s = System.currentTimeMillis(); for(long i = 0; i < Integer.MAX_VALUE; ++i){ sx += i; } System.out.println("f1(): " + (System.currentTimeMillis() - s)); } public static...

improving site performance..

Hi, I have a site http://www.ratingscorner.com/colleges i have an issue like performance. I think the site is slow. Please see if the speed is feasible . Its o a shared server. what things should i do to increase site/DB performance. when i try explain command on select command on main table it says like id select_type tabl...

Frequent inserts into sorted collection.

I have sorted collection (List) and I need to keep it sorted at all times. I am currently using List.BinarySearch on my collection and then insert element in right place. I have also tried sorting list after every insertion but the performance in unacceptable. Is there a solution that will give better performance? Maybe I should use ot...

Combining JavaScript files as recommended by YSlow - optimal size?

We have about 30 external JavaScripts on our page. Each is already minified. To reduce HTTP requests and page load time, we are considering combining them to a single file. This was recommended by the YSlow tool. Is this wise, or is it better to combine them into, say, two files with 15 scripts each? Is there an optimal size for the c...

iPhone cost vs. benefit - OpenGL ES 1.x vs 2.0

I'm not sure if this question has been asked already, my stackoverflow-fu has failed me. So I'm building an OpenGL-ES-based iPhone game and pretty much all of the examples I've found out in the wild are on OpenGL ES 1.x. Which is fine because at least I'm (re)learning a lot about OpenGL in general. Now that newer devices support OpenG...

The fastest GZIP decompress library in .NET

Which .NET library has the fastest decompress performance (in terms of throughput)? There are quite a few libraries out there... GZipStream DotNetZip Xceed Zip for .NET SevenZipLib SharpZipLib | community sponsor of Xceed Zip for .NET ...and I expect there are more I haven't listed. Has anyone seen a benchmark of the throughput pe...

support of Cocos2d-iphone for iPhone 4 high res

Hi all, I'm trying to create a relatively simple game with 2D graphics which has somewhat complicated animations. I tried to develop the game with the basic Core Graphics and Core Animation libraries but the animation performance of the game objects is not satisfactory (i.e. jerky/delayed). So, I am now looking into Cocos2D which looke...

How do I improve SQL Server query performance when doing a LIKE over many columns.

My query needs to do a LIKE search over 3 columns. SELECT * FROM Monkeys WHERE [Name] LIKE '%pete%' OR [Desc] LIKE '%pete%' OR [Info] LIKE '%pete%'; I am looking to improve the performance of this query. I can't use full-text catalogs, just simple tables. There are about 200,000 rows (SQL Server 2008 database) and it takes 3 to 6 sec...

Floating Point Div/Mul > 30 times slower than Add/Sub?

I recently read this post: http://stackoverflow.com/questions/2550281/floating-point-vs-integer-calculations-on-modern-hardware and was curious as to the performance of my own processor on this quasi-benchmark, so I put together two versions of the code, one in C# and one in C++ (Visual Studio 2010 Express) and compiled them both with op...

Data design - multiple short trips vs one big trip

Boiled down: Is it better to have the calculated field returned with the rest of the results or is it better to calculate it later when you need it? Example: I have a GridView that displays search results that has many fields like: Application ID Name Account Type Account Number etc. The account number field is not always consisten...

Sql Server - Merging large tables without locking the data

I have a very large set of data (~3 million records) which needs to be merged with updates and new records on a daily schedule. I have a sproc that actually breaks up the recordset into 1000 record chunks and uses the MERGE command with temp tables in an attempt to avoid locking the live table while the data is updating. The problem is...

SQL query to get data from a large list of strings

I have a large list of strings (1500 email addresses to be more specific) and I need to look up a piece of data in a very large DB table for each of the strings (e.g. the primary key, mydataitem). How can I do it efficiently? For example, this is way too slow (amongst other problems): $stringArray = ('foo','bar','baz',..., 'for 1000s...

How to force IE to show page content before finishing all Javascript execution?

On a Ruby on Rails development environment, a page will be shown after 30 seconds on Firefox, but takes 90 seconds on IE 8 (with IE 7 Compatibility Mode). Further investigation shows that it should be Javascript that slowed down the page, because if Javascript is turned off, then the page content will also show in 30 seconds. Because t...

Performance evaluation tools for C++

Hi everyone, I am really not sure if such a tool exits but let me describe it in few words. I want to measure the performance of a small library I am writing. Basically the library does arbitrary precision arithmetic. I would like to compare the performance of the library against available libraries and get the statistics of the tests. ...

Storing DateTime field in lucene document

What is the best way to add datefield to a document (i just need YYYYMMDD) Whats the best way to query against datefield Im creating the datefield as the following newDoc.Add(new Field("newsdate", "", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS)); but it slow down searches when adding a criteria of this field. what should i d...

If Javascript code block is not at end of HTML file, but is using jQuery's $(document).ready(function() {...}), will it slow down the page display?

It is said that Javascript code should be all placed at the end of HTML file, so that the page content is shown first, for the user to see something (so that the user is satisfied to see something instead of waiting another 12 seconds, for example). But to better encapsulation of the HTML and match Javascript code, such as an "Image Car...