Questions related to improving application performance, this can be range from selection software architecture to selection of algorithms.

learn more… | top users | synonyms

84
votes
11answers
22k views

What backs up the claim that C++ can be faster than a JVM or CLR with JIT? [closed]

A reoccurring theme on SE I've noticed in many questions is the ongoing argument that C++ is faster and/or more efficient than higher level languages like Java. The counter-argument is that modern JVM ...
1
vote
1answer
100 views

Eager Loading Constraints

The thing is, eager loading some object with all of it's associations reduces the queries made to the database, but the query time is greatly increased. The question is: This increased query time in ...
7
votes
7answers
1k views

Should I charge a client for mistakes that I made? [duplicate]

After developing a website for a client, I've realized that the load time is too extreme, and some changes need to be made. The extreme load times are attributed to the bloated css/js frameworks that ...
2
votes
5answers
427 views

What are good practices to perform software based optimization?

On a project that I am working on we encountered some performance problems. We decided to drop hibernate in favor of plain Jdbc to gain database performance. By converting our code to Jdbc we ...
2
votes
3answers
1k views

Does mobile based (Android) development, benefit from Object Oriented Programming?

My development on Android is based on scientific programs and while I'm building these most of the code is in one or two long classes. When I come to deploy these programs I try to decouple everything ...
5
votes
1answer
2k views

In MATLAB, how can 'preallocating' cell arrays improve performance?

I was reading this article on MathWorks about improving MATLAB performance and you will notice that one of the first suggestions is to preallocate arrays, which makes sense. But it also says that ...
11
votes
6answers
7k views

Is there any reason to use varchar over text columns in a database?

Is varchar just a remnant from before text came around, or are there use cases where you would want to use a varchar? (Or char for that matter..) (I use Postgres and MySQL (MyISAM) daily, so those ...
2
votes
2answers
1k views

memory and time intensive php task

Sorry if this question has been asked before, but I couldn't find anything usable. I'm working on a project for a client and currently I have to loop through the users table which is about 3000 ...
4
votes
2answers
675 views

How to test the render speed of my solution in a web browser?

Ok, I need to test the speed of my solution in a web browser, but I have some problems, there are 2 versions of the web solution, the original one that is on server A and the "fixed" version that is ...
0
votes
3answers
371 views

Does connection pooling work fine to execute 60 DB queries to load a page?

We use Linq2Sql in an ASP.NET application. Unfortunately the eager-loading in Linq2Sql isn't as powerful as in Entity Framework, so a lot of the data has to be lazy loaded as needed. Taking ...
15
votes
8answers
1k views

Ways to break the “Syndrome of the perfect programmer” [closed]

I am probably not the only one that feel that way. But I have what I tend to call "The syndrome of the perfect programmer" which many might say is the same as being perfectionist but in this case it's ...
1
vote
1answer
217 views

Ruby using the Gosu framework: why it runs slow first time?

I'm creating a Ruby game using the Gosu framework. All good. Sometimes, when I run the game, it has some kind of slow startup, and probably it will be rather slow during the whole game. So I close it ...
4
votes
1answer
414 views

What is Rainbow (not the CMS)

I was reading this excellent blog article regarding speeding up the badge page and in the last comment the author waffles (a.k.a Sam Saffron) mentions these tools: dapper and a bunch of custom ...
3
votes
2answers
2k views

How to hide the python code from users?

I am developing a paid application in python. I do not want the users to see the source code or decompile it. How can I accomplish this task to hiding the source code from the user but running the ...
10
votes
4answers
2k views

What is the meaning of the sentence “we wanted it to be compiled so it’s not burning CPU doing the wrong stuff.”

I was reading this article. It has the following paragraph. And did Scala turn out to be fast? Well, what’s your definition of fast? About as fast as Java. It doesn’t have to be as fast as C or ...
3
votes
4answers
291 views

Create new variable or make multiple chained calls?

What is the best way to get this attributes, thinking in performance and code quality? Using chained calls: name = this.product.getStock().getItems().get(index).getName(); id = ...
6
votes
1answer
623 views

Is event sourcing ready for prime time? [closed]

Event Sourcing was popularized by LMAX as a means to provide speed, performance scalability, transparent persistence and transparent live mirroring. Before being rebranded as Event Sourcing, this type ...
8
votes
5answers
3k views

Improving performance for grepping over a huge file

I have FILE_A which has over 300,000 lines and FILE_B which has over 30 million lines. I created a Bash script that greps each line in FILE_A over in FILE_B and writes the result of the grep to a new ...
20
votes
6answers
15k views

Why is quicksort better than other sorting algorithms in practice?

This is a repost of a question on cs.SE by Janoma. Full credits and spoils to him or cs.SE. In a standard algorithms course we are taught that quicksort is O(n log n) on average and O(n²) in the ...
7
votes
6answers
2k views

Software Optimization vs. Hardware Optimization - what has the bigger impact?

I was wondering how software optimization and hardware optimization compare when it comes to the impact they have on speed and performance gains of computers. I have heard that improving software ...
-4
votes
6answers
2k views

Is having two conditions in an IF statement faster than having two separate IF statements?

I just wonder if having two conditions in an IF statement executes faster than having it separated into two like these: Single Statement, two conditions if ( (conditionA == true) && ...
107
votes
12answers
23k views

Should we avoid object creation in Java?

I was told by a colleague that in Java object creation is the most expensive operation you could perform. So I can only conclude to create as few objects as possible. This seems somewhat to defeat ...
5
votes
1answer
120 views

When to use shared libraries for a web framework?

tl;dr: I've found myself hosting a bunch of sites running on the same web framework (symfony 1.4). Would it be helpful if I moved all of the shared library code into the same directory and shared it ...
3
votes
6answers
626 views

How do I determine if my code is optimized?

I am only developer working on a project. The functionality that I have coded works to expectations(desired result) but since I am the only one I don't know if I can do anything better to it. How do I ...
3
votes
2answers
186 views

Patterns for integrating with a slow external service

Was hoping someone could provide some patterns/techniques/ideas to increase performance for the following scenario. Am integrating with an external ordering system via SOAP. The external system can ...
4
votes
6answers
464 views

Information about how much time in spent in a function, based on the input of this function

Is there a (quantitative) tool to measure performance of functions based on its input? So far, the tools I used to measure performance of my code, tells me how much time I spent in functions (like ...
4
votes
5answers
657 views

Would “Efficient C++” book be irrelevant now due to compiler improvements? [closed]

I am planning on purchasing this book to learn more about C++ programming with regards to fast code. However, the book was published in 1999 and I am worried most of it may be irrelevant now due to ...
2
votes
1answer
1k views

What metrics should be used to measure memory consumption of a program for performance test?

I am asked to provide performance statistics for a program, one of them being memory consumption. I noticed that in perfmon or in .NET API there is apparently many variable related to memory usage, ...
0
votes
1answer
296 views

Splitting an image into many pieces to improve perceived performance? Good or Bad? [closed]

Time to time, I have to work on a website that involves a huge background in size and resolution (1920 x 1080 in resolution, over 2mb in size). I've been using preloaders and it worked very well, ...
1
vote
7answers
8k views

Merge sort versus quick sort performance

I have implemented merge sort and quick sort using C (GCC 4.4.3 on Ubuntu 10.04 running on a 4 GB RAM laptop with an Intel DUO CPU at 2GHz) and I wanted to compare the performance of the two ...
3
votes
1answer
3k views

Magic square check for N×N matrix with minimum complexity

Is there any algorithm that works better than O(n²) to verify whether a square matrix is a magic one (e.g. such as sum of all the rows, cols and diagonally are equal to each other)? I did see someone ...
10
votes
4answers
8k views

How can I monitor the JVM memory in a proper way?

I'm thinking of how we do JVM memory monitor in a low overhead way in production environment even under busy hour. Suppose I have two tomcat app server in production, load balance set up behind them. ...
4
votes
5answers
2k views

Structuring database for multi-object “activity” and “following” functionalities

I am working on a web application which operate with different types of objects such as user, profiles, pages etc. All objects have unique object_id. When objects interact it may produce "activity", ...
0
votes
2answers
350 views

Desktop GUI loading slow

I am developing desktop based GUI (single form) using wxPython and loads it using remote citrix access from client private network. Suppose, the GUI has certain group of select and text boxes which ...
0
votes
7answers
4k views

Performance analysis of C++ programs [closed]

How can I measure the performance of my C++ programs using C++? Specific metrics I want to measure are: Memory used (space) Duration taken (time)
0
votes
2answers
179 views

How can describe slow connection issues?

I have been working on a website containing 3d maps, virtual 3d tours, etc. All of the content is large like images and video. The problem is the site performs well under normal speed connections but ...
-1
votes
2answers
232 views

How should I group these variables?

I have a shape that will be defined by: char s_type; char color; double height; double width; These variables are scanned in from a request string sent to my server and passed into my printing ...
4
votes
1answer
310 views

Inexpensive generation of hierarchical unique IDs

My application is building a hierarchical structure like this: root = { 'id': 'root', 'children': [ { 'name': 'root_foo', 'children': [] }, { 'id': 'root_foo2', 'children': [ { ...
17
votes
2answers
11k views

Writing low latency Java [closed]

Are there any Java-specific techniques (things which wouldnt apply to C++) for writing low latency code, in Java? I often see Java low latency roles and they ask for experience writing low latency ...
1
vote
1answer
2k views

Improving performance for web scraping code

I have a website in which the code scrapes other websites for getting the accurate data. While the code works good but there a decent lag in performance because the code firsts downloads the html ...
5
votes
4answers
2k views

JSF for an internet facing, high traffic web application

I, perhaps, made a wrong choice of going with a Component-based Framework like JSF for an internet facing, high traffic web application. Development with JSF has although been easier but what I fear ...
7
votes
4answers
628 views

Is there a performance benefit to using immutable objects in a scripting language?

As I understand it, writing your objects in an immutable style can help the performance of your program for compiled languages, as the compiler tends to rewrite your code in single static assignment ...
4
votes
2answers
161 views

Is performance testing applicable to a QA or business user testing?

Performance testing is something that I, as a developer do when optimizing. However, if the change is purely optimization, should the QA or business user perform their own performance testing? I would ...
8
votes
2answers
2k views

Eclipse runs my java program 6 times faster… Can I achieve this performance without using it?

I've written a java program that generates all repetitive permutations based on the characters and the length given. When I execute my code in Eclipse, it generates a file with 1,000,000 permutations ...
0
votes
1answer
165 views

Data structure to use for complex lookups in an event engine?

What would be an optimal way to organize arbitrary data types into a structure that allows for complex (non-index based) lookups into the data without performing full loop-through's? For a little ...
3
votes
7answers
215 views

Throwing an Exception if a Query Doesn't Use an Index

I'm working on a largish webapp that was developed by several other programmers and I keep running into performance issues caused by poorly written SQL queries and queries that don't use an index. ...
1
vote
4answers
2k views

How do I speed up XML parsing operation?

I currently have a php script set up to do some xml parsing. Sometimes the script is set as an on page include and other times it is accessed via an ajax call. The problem is the load time for this ...
6
votes
2answers
510 views

Session size management

From what I know, the session information is usually saved on the server. In Java the data is handled as a Map which I guess contains the a String identifier and an object reference which points to a ...
3
votes
2answers
182 views

Where can I find good example of techniques to compact data in-memory? [closed]

I'm writing a Java framework to manipulate a large amount of data in-memory, where many "cells" that are near each other will have the same value. I'm looking for algorithms and/or techniques ...
3
votes
1answer
204 views

How to optimize methodology to collect Market Data?

I am working on Application which goes and get's market data from different sources, I am using polling mechanism where vendor/broker put his data file and my application would go and hit that ftp ...