performance

PreparedStatements and performance

So I keep hearing that PreparedStatements are good for performance. We have a Java application in which we use the regular 'Statement' more than we use the 'PreparedStatement'. While trying to move towards using more PreparedStatements, I am trying to get a more thorough understanding of how PreparedStatements work - on the client side ...

append conditional html file output with xml response

hey guys i have a restful xml service where client passes current version of html they are viewing. if the version on the server is the same as the client, i just respond with the current server version in xml. example: <Response ServerHTMLVersion="1" /> however if server html version is greater than current client version, i still spit...

Java Profiling: Private Property Getter has Large Base Time

I'm using TPTP to profile some slow running Java code an I came across something interesting. One of my private property getters has a large Base Time value in the Execution Time Analysis results. To be fair, this property is called many many times, but I never would have guessed a property like this would take very long: public class...

Which are more performant, CTE or temporary tables?

Which are more performant, CTE or temporary tables? ...

How can I reduce Perl CGI script start-up time?

I'm developing some CGI scripts and I'm trying to find a solution to decrease the "starting time" produced when I import a lot of modules with "use". ...

Static Property and lock Usage

Is this code correct or is there any possibility of some random threading deadlocks etc? Is it a good idea to use static properties and locking together? Or is static property thread-safe anyway? Private Shared _CompiledRegExes As List(Of Regex) Private Shared Regexes() As String = {"test1.Regex", "test2.Regex"} Private Shared RegExSet...

C#: poor performance with multithreading with heavy I/O

Hi, I've written an application in C# that moves jpgs from one set of directories to another set of directories concurrently (one thread per fixed subdirectory). The code looks something like this: string destination = ""; DirectoryInfo dir = new DirectoryInfo(""); DirectoryInfo subDirs = dir.GetDirectories(); ...

Javascript: Performance of .className Changes vs. .style Changes

Back in 2005, Quirksmode.com released this article: http://www.quirksmode.org/dom/classchange.html that showed "proof" that changing the style of an element by changing its class (ie. "elem.className = x") was almost twice as fast as changing its style via its style property (ie. "elem.style.someStyle = x"), except in Opera. As a resu...

ASP.NET How expensive is it to call an Application Variable many times?

The short of it is: Is it costly to check an Application Variable such as Application("WebAppName") more 10-20 times each time a page loads? Background: (feel free to critique) Some includes in my site contain many links and images which cannot use relative urls due to their inclusion in different paths. Hence these includes contain ...

How should I estimate hardware requirements for SQL Server 2005 database?

We're being asked to spec out production database hardware for an ASP.NET web application that hasn't been built yet. The specs we need to determine are: Database CPU Database I/O Database RAM Here are the metrics I'm currently looking at: Estimated number of future hits to website - based on current IIS logs. Estimated worst-case...

What is the best way to add two strings together?

I read somewehere (I thought on codinghorror) that it is bad practice to add strings together as if they are numbers, since like numbers, strings cannot be changed. Thus, adding them together creates a new string. So, I was wondering, what is the best way to add two strings together, when focusing on performance? Which of these four is ...

How solve slow scrolling in UITableView

I test for first time in the real device, and after fixing some obvious performance problems I'm stuck in how do a smoth scrolling. This is what I do: The data is in sqlite I have a small array with the header I have in each header array the list of Id's from the Db Ej: Header A Ids= 1,2 Header B Ids= 3,4 I load lazy the c...

web performance test for video streaming

Hello everyone, I have some streamed video setup on IIS. And I want to find or write some tool to test the performance, such as max supported simultenaous users/connections, and I also want to test such performance under user activity like pause, rewind or forward. Any ideas? I am using Windows Server 2008 x64 + IIS 7.0 Media Pack to s...

When to use memoization in Ruby on Rails

In mid July 2008 Memoization was added to Rails core. A demonstration of the usage is here. I have not been able to find any good examples on when methods should be memoized, and the performance implications of each. This blog post, for example, suggests that oftentimes, memoization should not be used at all. For something that could p...

.NET object hydration from IDataReader slow performance

I am trying to hydrate a list of ~400 business objects and the performance becomes very slow when it needs to hydrate strings. It's taking in excess of 20secs to hydrate the 400 objects. EDIT We are using MySQL 5.1 and dotConnect for MySQL v5.0.12 as the data provider http://www.devart.com/dotconnect/mysql/ I did some benchmarks to na...

MySQL: Many tables or many databases?

For a project we having a bunch of data that always have the same structure and is not linked together. There are two approaches to save the data: Creating a new database for every pool (about 15-25 tables) Creating all the tables in one database and differ the pools by table names. Which one is easier and faster to handle for MySQL?...

What is an acceptable time to first byte?

This is the waterfall view I'm seeing on my blog: http://www.webpagetest.org/result/090330_1A67/1/details/ It seems to me that 4 seconds for the time to first byte would indicate a server issue. Any thoughts on what is going on or what I can do to fix this initial delay? ...

What could cause the application as well as the system to slowdown?

I am debugging an application which slows down the system very badly. The application loads a large amount of data (some 1000 files each of half an MB) from the local hard disk.The files are loaded as memory mapped files and are mapped only when needed. This means that at any given point in time the virtual memory usage does not exceed 3...

Smart typedefs

I've always used typedef in embedded programming to avoid common mistakes: int8_t - 8 bit signed integer int16_t - 16 bit signed integer int32_t - 32 bit signed integer uint8_t - 8 bit unsigned integer uint16_t - 16 bit unsigned integer uint32_t - 32 bit unsigned integer The recent embedded muse (issue 177, not on the website yet) intr...

WPF Datagrid Performance

I am working with the WPF Toolkit data grid and it is scrolling extremely slow at the moment. The grid has 84 columns and 805 rows. (Including 3 fixed columns and the header is fixed.) Scrolling both horizontally and vertically is extremely slow. Virtualization is turned on and I have enabled column virtualization and row virtualizati...