performance

Refactoring (and testing) for performance

I have a library that provides a reflection API on top of describeType() (a method that returns an XML object with all the specs of a class or instance). Since this library is used in several other libraries and frameworks, I really want it to be as fast as possible. The problem I'm facing is that I'm not sure about the best approach to...

Why does PostgresQL query performance drop over time, but restored when rebuilding index

According to this page in the manual, indexes don't need to be maintained. However, we are running with a PostgresQL table that has a continuous rate of updates, deletes and inserts that over time (a few days) sees a significant query degradation. If we delete and recreate the index, query performance is restored. We are using out of ...

Performancetest: Flash/AS3 Processing/Java and openFrameworks/C++

Hi there, I need to compare the performance of AS3, Processing and openFrameworks for my Bachelor thesis. Are there any comparison tables you know of or do I have to do the test myself? How would a good test look like? I'm just focused on graphics so I thought about maybe three different programs, a 2d-graphics app, a typographic-app ...

WPF drawing performance with large numbers of geometries

Hello, I have problems with WPF drawing performance. There are a lot of small EllipseGeometry objects (1024 ellipses, for example), which are added to three separate GeometryGroups with different foreground brushes. After, I render it all on simple Image control. Code: DrawingGroup tmpDrawing = new DrawingGroup(); GeometryGroup onGroup...

Today's best approaches on scalable high-performance PHP-applications

Hi everybody! We are in the startup build phase of a new PHP webapp that will be placed onto a cloud server to allow fast and easy up/downscaling when customers will grow or decrease in numbers. Most probably, we will use a PHP framework (Codeigniter) to keep development speed high. Our next step is to implement features for increased ...

const vs static in PHP

IN PHP5 i can declare a const value to a class: class config { const mailserver = 'mx.google.com'; } But i can also declare public static: class config { public static $mailserver = 'mx.google.com'; } In case of a config file which i will later us, like: imap_connect(config::$mailserver ... imap_connect(config::mailserve...

' ... != null' or 'null != ....' best performance?

I wrote two methods to check there performance public class Test1 { private String value; public void notNull(){ if( value != null) { //do something } } public void nullNot(){ if( null != value) { //do something } } } and checked it's byte code after compiling public void notNull(); Code: Stack=1, Locals=1, Args_si...

How does Google App Engine precompile Java ?

App Engine uses a "precompilation" process with the Java bytecode of an app to enhance the performance of the app in the Java runtime environment. Precompiled code functions identically to the original bytecode. Is there any detailed information what this does? ...

Is it possible to simulate load balancers, and how much performance gain they provide?

I have a website which runs on IIS (Asp.net application, some of them are in dotnetnuke also) and we are expecting higher numbers of traffic on some of the sites, so we are planning to add a load-balancer, but before going to do that, we just want to know is it worth to do that? So, I want to know if is it possible to simulate load balan...

How do you handle browser cache with login/logout?

To improve performances, I'd like to add a fairly long Cache-Control (up to 30 minutes) to each page since they do not change often. However, each page also displays the name of the user logged in (like this website). The problem is when the user logs in or logs out: the user name must change. How can I change the user name after each l...

Writing shorter code/algorithms, is more efficient (performance)?

After coming across the code golf trivia around the site it is obvious people try to find ways to write code and algorithms as short as the possibly can in terms of characters, lines and total size, even if that means writing something like: //Code by: job //Topic: Code Golf - Collatz Conjecture n=input() while n>1:n=(n...

Must .aspx files have a page directive?

Around 90% of the pages for our websites have no .Net code embedded in them yet are published as .aspx files. I want these to render as fast as possible so I'm removing as much as I can. Does the .Net page directive have an impact on performance? I am thinking about two factors; the page speed for each GET and what happens when the fi...

What might cause the big overhead of making a HttpWebRequest call?

When I send/receive data using HttpWebRequest (on Silverlight) in small blocks, I measure the very small throughput of 500 bytes/s over a "localhost" connection. When sending the data in large blocks, I get 2 MB/s, which is some 5000 times faster. Does anyone know what could cause this incredibly big overhead? Additional info: I'm...

The fastest way to do a collection subtraction

I have two Sets. Set b is the subset of Set a. they're both very huge Sets. I want to subtract b from a , what's the best practice to do this common operation ? I've written to many codes like this , and I don't think it's efficient. what's your idea ? pseudo code : (this is not Java API) . for(int i = 0 ; i < a.size(); i++) { ...

Is it worth migrating to NHibernate 2.x from NHibernate 1.2?

We are using nHibernate 1.2 in a system which is not performing good. Will there be some performance improvement if we migrate to latest version of nHibernate? Overall is it a good idea to migrate to the latest version of nHibernate? EDIT: I want to use following features to improve performance. 1. Second level cache. 2. Joined Tab...

SQL Server 2005 high memory usage and performance problems

Hi there guys. I have this ASP.NET/SQLServer2005 website running on a production server (Win2003, QuadCore, 4GB). The site runs smoothly normally, but after 2-3 weeks I notice a slow performance on the site (especifically in one particular page). Also I notice that the SQL Server process is using like 2GBs of RAM. So I restart the serv...

How to populate an array with recordset data

I am attempting to move data from a recordset directly into an array. I know this is possible, but specifically I want to do this in VBA as this is being done in MS Access 2003. Typically I would do something like the following to archive this: Dim vaData As Variant Dim rst As ADODB.Recordset ' Pull data into recordset code here... ...

Inline javascript performance.

I know it is better coding practice to avoid inline javascript like: <img id="the_image" onclick="do_this(true);return false;"/> I am thinking about switching this kind of stuff for bound jquery click events like: $("#the_image").bind("click",function(){ do_this(true); return false; }); Will I lose any performance if I bi...

How to speed up the reading of innerHTML in IE8?

I am using JQuery with the DataTable plugin, and now I have a big performnce issue on the following line. aLocalData[jInner] = nTds[j].innerHTML; // jquery.dataTables.js:2220 I have a ajax call, and result string in HTML format. I convert them into HTML nodes, and that part is ok. var $result = $('<div/>').html(result).find("*:first"...

Javascript scope chain

Hi, I am trying to optimize my program. I think I understand the basics of closure. I am confused about the scope chain though. I know that in general you want a low scope (to access variables quickly). Say I have the following object: var my_object = (function(){ //private variables var a_private = 0; return{ //...