performance

Should you accurately specify column types in MySQL?

When I define columns in MySQL I generally use int, varchar(255), text and the occasional enum for boolean. What are the benifits of accurately specifying column types rather than just leaving them at maximum? For example a password field encoded as MD5 will never exceed 32 characters so is there a tangible performance gain from using ...

Poor performance by overriding Java class?

I have the following class subclass of FilterInputStream with only one method overrided. However the performance of this class is so poor. It performs at 1/10 the speed of its superclass. I even took the same source code from InputStream of javasrc and used it in my subclass. Same performance hit. Is there something wrong with overriding...

Is it better to call ToList() or ToArray() in LINQ queries?

I often run into the case where I want to eval a query right where I declare it. This is usually because I need to iterate over it multiple times and it is expensive to compute. For example: string raw = "..."; var lines = (from l in raw.Split('\n') let ll = l.Trim() where !string.IsNullOrEmpty(ll) ...

Big O question

If I have the following code: IterateArray(object[] array) { for(int i=0; i<array.length; i++) { Dosomething(array[i]); } } and the Dosomething(object) method's time performance is O(log n), is the overall performance of IterateArray O(n) or O(n log n)? Thanks. ...

improving Boyer-Moore string search

I've been playing around with the Boyer-Moore sting search algorithm and starting with a base code set from Shriphani Palakodety I created 2 additional versions (v2 and v3) - each making some modifications such as removing len() function from the loop and than refactoring the while/if conditions. From v1 to v2 I see about a 10%-15% impr...

SQL Server won't use my index

I have a fairly simple query: SELECT col1, col2… FROM dbo.My_Table WHERE col1 = @col1 AND col2 = @col2 AND col3 <= @col3 It was performing horribly, so I added an index on col1, col2, col3 (int, bit, and datetime). When I checked the query plan it was ignoring my index. I tried reordering the columns in t...

Web App Performance Problem

I have a website that is hanging every 5 or 10 requests. When it works, it works fast, but if you leave the browser sit for a couple minutes and then click a link, it just hangs without responding. The user has to push refresh a few times in the browser and then it runs fast again. I'm running .NET 3.5, ASP.NET MVC 1.0 on IIS 7.0 (Win...

Will multi threading provide any performance boost?

Hello everyone, I am new to programming in general so please keep that in mind when you answer my question. I have a program that takes a large 3D array (1 billion elements) and sums up elements along the various axis to produce a 2D array of a projection of each side of the data. The problem here is that it is very ram intensive as th...

Is there a Performance Difference in having Code in the ASPX file?

Putting code at aspx files is slower? The code is recompiled every access? At my mind, code at aspx file is compiled at first access together their dll(maybe in Page_Init) and moved to Temp Asp.Net folder. And .aspx file just is necessary for IIS found a file. ...

Benchmarking Performance on Java VM vs .Net CLR

Have you ever had to justify the choice over using .Net instead of Java based on performance? For a typical high volume transaction processing system that can perform the following operations, Concurrent Database transactions Mathematical computations Interaction with other web services (SOAP/XML, XML-RPC) My approach would be to co...

Why does Flex use a single threaded model?

Over the past few weeks I have been building a prototype application using a Flex front end connected to a J2EE backend using blazeDS. The prototype is an experiment to learn flex and see what its suitability is for a complex trading application requiring a large number of dynamic updates (i.e > 20 a second) via a pub sub type model. D...

Performance testing scenarios required

What can be the various performance testing scenarios to be considered for a website with huge traffic? Is there any way to identify the elements of the code which are adversely affecting the site performance? Please provide something similar to checklist of generalised scenarios to be tested to ensure proper performance testing. ...

Cost of passing an optional parameter to a method rather than computing it

I have a memory block that is divided into a series of location that can be retrieved and returned by client code. The method that returns locations back looks like this: void ReturnLocation(void *address) { int location = AddressToLocation(address); // I need the location here // some code DoSmthA(location); } void DoSmth...

Use variables or "inject" jquery selectors when chaining?

Hi, is it better to do this (regarding performance, not readability...): $('a.updateCartButton').click(function() { $('form[name=updateCartForm]').attr('action', $(this).attr('href') + '#' + $('img[id^=iconUpdateArticle]').attr('id')).submit(); return false; }); or this: $('a.updateCartButton').click(function() { var actionHre...

unknown performance issue

in our sql server box(X64 machine with 8 core with 16G Ram), we found the performance is really bad after we a bunch of data been generated, some time we even cannot RDP to this box, there have several err msg on SQL error log as following: *2009-06-26 12:11:09.92 spid63 Error: 14151, Severity: 18, State: 1. 2009-06-26 12:11:09.92...

How are regular expressions implemented in .NET? (C#)

I have just read this interesting article about the implementation details for various languages that support regular expressions. It describes an alternative implementation of regular expressions that uses non-deterministic finite automatons (NFAs) versus deterministic ones (DFAs). It claims that back-tracking DFA implementations (t...

Powershell script running more slowly in a runspace than in the shell

I've a PS script which I use to keep track of my VMWare ESX servers. I need to run it as a service so that I'm not permanently logged on. Unfortunately, the script runs more slowly if I use a runspace inside a service rather than just running the script through the powershell console. It's taking 2-5 minutes to make calls to the VMWare w...

Poor Performance When Dynamically Resizing a WPF TextBlock

I'm currently working out the layout of a WPF Application and seem to have it a bit of a snag in the layout of one of my controls. This control is a dynamically sizing, so it should fit the size of the viewport it's a part of. The problem I'm running into is a very visual problem, so I'll do my best to describe it. Here's what it looks l...

High-performance wiki-schema

Hello, I'm using MS SQL Server 2005. What's the best schema for a Wiki-like system? where users edit/revise a submission and the system keeps track of these submissions. Lets say we're doing a simple wiki-based system. Will keep track of each revision plus views and latest activity of each revision. In other screens, the system will l...

How to measure cpu over-head introduced by the hprof profiler attached to a jvm

Hi I'm running IBM's jvm (jdk 5.0) with the options -XrunHprof:format=b I'm aware that instrumenting jvm with hprof involves a performance penality. I would like to quantify that penality. I know that one way to do this is to take off the hprof profiling and run the application, and compare the application's cpu utilization in both cas...