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

learn more… | top users | synonyms

5
votes
1answer
594 views

How can I compute the Big-O notation for a given piece of code? [closed]

So I just took a data structure midterm today and I was asked to determine the run time, in Big O notation, of the following nested loop: for (int i = 0; i < n-1; i++) { for(int j = 0; j < ...
1
vote
1answer
360 views

Metrics / Methodology for estimating resource utilization for software in planning stage

I'm looking for approaches to estimate the resource utilization of an (web-)application in a JEE environment. The overall target is to get a forecast for hardware/software requirements while the ...
3
votes
2answers
446 views

Is script grouping and minification counter-productive?

On a web page I have 1 script tag that contains all my minified JavaScript (I use SquishIt for .NET). However I see that a few people prefer to load their scripts in parallel using something like ...
26
votes
9answers
2k views

Simple vs Complex (but performance efficient) solution - which one to choose and when?

I have been programming for a couple of years and have often found myself at a dilemma. There are two solutions - one is simple one i.e. simple approach, easier to understand and maintain. It ...
6
votes
1answer
2k views

Performing client-side OAuth authorized Twitter API calls versus server side, how much of a difference is there in terms of performance?

I'm working on a Twitter application in Ruby on Rails. One of the biggest arguments that I have with other people on the project is the method of calling the Twitter API. Before, everything was done ...
6
votes
1answer
263 views

Optimizing hash lookup & memory performance in Go

As an exercise, I'm implementing HashLife in Go. In brief, HashLife works by memoizing nodes in a quadtree so that once a given node's value in the future has been calculated, it can just be looked ...
1
vote
2answers
494 views

What is faster and preferable way for variable assignment in ruby? [closed]

I am a RoR developer and want to clarify some doubt about ruby variable assignment. In ruby we have two ways for variable assignment. str, arr, num = "Hi", [1, 2], 3 and str = "Hi" arr = [1, 2] ...
18
votes
12answers
9k views

Compilable modern alternatives to C/C++ [closed]

I am considering writing a new software product. Performance will be critical, so I am wary of using an interpreted or language or one that uses a emulation layer (read java). Which leads me to ...
0
votes
2answers
342 views

The limit of Int32 for Identity Column

This is just a consideration for a site am creating and for other big sites out there. I am using Identity Column to store the ID of some of my tables and I have classes whose Id are decorated with ...
8
votes
1answer
408 views

Is there any better approach to shortest path finding within a (vehicular) traffic network?

Dear fellow programmers, We're developing software which simulates vehicular traffic. Part of the process called "assignment" is concerned with assigning vehicles to their routes and has to use some ...
8
votes
2answers
2k views

What does it mean by expected running time and average runnnig time of an algorithm?

Let's say we want to analyze running time of algorithms. Sometimes we say that we want to find the running time of an algorithm when the input size is n and for the worst possible case it is denote it ...
86
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
101 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
428 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 ...
13
votes
6answers
8k 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
2k 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
696 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
375 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
2k 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
220 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
422 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
295 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
625 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
16k 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) && ...
111
votes
12answers
25k 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
121 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
631 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
478 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
659 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
302 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
355 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
181 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
234 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
314 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 ...