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

learn more… | top users | synonyms

11
votes
6answers
6k 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 ...
-3
votes
0answers
25 views

how to analyze java application performance optimization in practical way [on hold]

Is there any specific tools to know our java application performance ?It means that to observer our source code directly in which module and where the performance might degrading...
0
votes
2answers
108 views

Infinite while loop CPU usage

I'm coding an script in C, which is going to check constantly an array of events, the idea is to check if the Date and time of certain event is equal to de current time and trigger something, i'm ...
0
votes
2answers
112 views

Should I worry about performance, even if there is no loss of convenience? [duplicate]

Assume an application that shows a data table. The data is loaded from a database when the program is initialized. Each value in the table is represented by an input field, where each keypress in one ...
3
votes
1answer
250 views

Why did Shannon's outguessing machine beat Hagelbarger's?

I'm reading "Rock Breaks Scissors", which describes two "outguessing machines" built at Bell Labs that try to exploit human non-randomness in the game of matching pennies. There was an outguessing ...
2
votes
3answers
236 views

Could the creation of many methods in Java affect performance? [closed]

I was told by a colleague that in Java, the performance may be worse if we create more methods, stacking many methods calling over them in JVM, specially in a Java EE environment. This seems to ...
0
votes
2answers
130 views

How does the Common Language Runtime improve performance? [duplicate]

I read on the wikipedia article for Common Language Runtime that one of the benefits that the runtime provides is "Performance improvements". Executing managed code (Or bytecode) must surely always ...
81
votes
11answers
21k 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 ...
3
votes
1answer
466 views

Hadoop and Object Reuse, Why?

In Hadoop, objects passed to reducers are reused. This is extremely surprising and hard to track down if you're not expecting it. Furthermore, the original tracker for this "feature" doesn't offer any ...
4
votes
2answers
92 views

To find the oldest/newest element in a heap

I want to find the oldest/newest element added into a heap of size k. At any given point of time if I have to find say the oldest element in the heap is there any approach with O(1) space and O(1) ...
2
votes
4answers
479 views

Why aren't we building and using parallel processors *meant* for general computation?

We all know GPUs are much faster than CPUs for a wide range of applications. When someone asks why we are not just programming for GPUs at all, one of the most common answers is that GPUs are not good ...
3
votes
7answers
216 views

Are mutliple database calls really significant with a network call for a web API?

At one of my employers, we worked on a REST (but it also applies to SOAP) API. The client, which is the application UI, would make calls over the web (LAN in typical production deployments) to the ...
3
votes
1answer
139 views

How do I add link-time optimization capabilities to my LLVM-based compiler?

I am designing and implementing a programming language, and I am using LLVM for native code generation. Among others, performance is a key feature of the language, and as such, I am looking to ...
0
votes
2answers
168 views

Mobile App Development-Architecture/Platform: Main performance concern: device/UI responsiveness [closed]

I am currently investigating different alternatives for building a mobile instant messaging application for iOS and Android, using an XMPP server (probably ejabberd) as the back-end. Main requirements ...
0
votes
2answers
102 views

Traffic splitter on a single server for 50+ krps [closed]

I am building a "splitter" for web traffic: a web server that will receive an HTTP request, forward it to two backend servers, choose the best response (for which it needs to parse all of them) and ...
0
votes
2answers
129 views

Whats a good structure to save and retrieve locations of images?

I got a java-ee application, where I collect informations about movies. Im my backend I provide data like the name, description, genre and a random uuid. I also got lots of related files, which are ...
-3
votes
1answer
46 views

How create unit test the performance of an application? [closed]

What I want is to run automatically methods to tests the performance of an application. Just like the unit tests, but with the purpose of evaluate the performance and create reports if is it possible. ...
1
vote
2answers
158 views

How to measure algorithm accuracy?

I have a few optimization algorithms (for finding function minimum) and I'd like to check how good they are. Suppose I build test cases and compare the actual results to theoretical ones. What ...
2
votes
2answers
160 views

Should I group all of my .js files into one large bundle?

One of the difficulties I'm running into with my current project is that the previous developer spaghetti'd the javascript code in lots of different files. We have modal dialogs that are reused in ...
27
votes
15answers
2k views

In the days of modern computing, in 'typical business apps' - why does performance matter? [closed]

This may seem like an odd question to some of you. I'm a hobbyist Java programmer. I have developed several games, an AI program that creates music, another program for painting, and similar stuff. ...
8
votes
5answers
913 views

Are there technical limitations or language features that prevent my Python script from being as fast as an equivalent C++ program?

I'm a long-time Python user. A few years ago, I started learning C++ to see what it could offer in terms of speed. During this time, I would continue to use Python as a tool for prototyping. This, it ...
1
vote
2answers
317 views

How to approach program design with respect to data strucutres and algorimths - is there an equivelant of the OO design process for d.s.'s + algs? [closed]

My applogies for probably the worst written body of text I have produced in my life and many thanks to those willing to plough through it all. I was (and still am) not able to clearly express what I ...
1
vote
1answer
54 views

Entity-Attribute-Value table vs single table for storage of posts, events and pages

I am trying to decide whether to just use individual tables with more fields for storing posts, pages and events or using tables with basic fields plus having EAV tables as well for fields that are ...
2
votes
3answers
244 views

Will object reuse optimize this often-called function?

Suppose I have a function that I need to call a lot, maybe a few thousand times on every mouse down or mouse move. It uses an instance of a function (class), called Transform: function func1(a, b, c) ...
2
votes
0answers
156 views

How to evaluate JNI approaches with Java and Fortran? [closed]

Right now we've got about 150k lines of Java broken into two major parts. The first contains an implementation of the algorithms we're hoping to redo in Fortran, and the second has a good chunk of GUI ...
0
votes
2answers
57 views

Static and dynamic data : should I use different databases?

Say I am building a website that uses two different types of data : Static : information that will hardly change, like movie awards or world countries names (I want fast access so no external API) ...
0
votes
1answer
130 views

Good approach for hundreds of comsumers and big files

I have several files (nearly 1GB each) with data. Data is a string line. I need to process each of these files with several hundreds of consumers. Each of these consumers does some processing that ...
-1
votes
1answer
58 views

Huge long addition overhead compared to Native call?

A run a simple test JDK 1.7.0_45 (Windows 7, 64bit): Test 1: long start = System.nanoTime(); for (int i=0; i < 1000000; i++) { System.currentTimeMillis(); } elapsed = ...
0
votes
4answers
236 views

What is the “1620's multiplication operation”?

I was stumbling through Wikipedia when I came across the entry for FLOPS, specifically the table in this section. The first entry is for a computer from 1961, the comment on the right reads The ...
-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) && ...
1
vote
4answers
127 views

Track performance numbers

I have a (large) software project in a git repository. There is a benchmark suite that spits out lots of numbers (time per benchmark, allocations done per benchmark) I’d like to track. What is the ...
0
votes
0answers
16 views

Defining property and find substitution for copy function of python in cython

I want to cythonize a code in python to speed up the code. In the following you can see my attempt to make my python class understandable for cython: import numpy as np cimport numpy as np ctypedef ...
3
votes
2answers
254 views

What's a good simple way to combat the n+1 problem?

I'm trying to better understand performance in PHP. One issue I'm thinking about is the n+1 problem. By n+1 I mean something like this: $posts = Posts::getPosts(); foreach($posts as $post) { ...
4
votes
1answer
196 views

Why does Haskell's built in max function run faster than mine?

I noticed that for some reason, Haskell's built in max function (which returns the greatest of two numbers) runs much faster than the one I wrote, even though they are essentially identical. From ...
5
votes
1answer
455 views

Why use Android Fragments?

I have read the documentation and some other questions' threads about this topic and I don't really feel convinced; I don't see clearly the limits of use of this technique. Fragments are now seen as ...
3
votes
3answers
233 views

Data Oriented Design - impractical with more than 1-2 structure “members”?

The usual example of Data Oriented Design is with the Ball structure: struct Ball { float Radius; float XYZ[3]; }; and then they make some algorithm that iterates a std::vector<Ball> ...
17
votes
4answers
587 views

How bad is it calling println() often than concatenating strings together and calling it once?

I know output to the console is a costly operation. In the interest of code readability sometimes it is nice to call a function to output text twice, rather than having a long string of text as an ...
4
votes
1answer
457 views

In Java, why use bit hacks when non-bitwise technique it is more readable?

Is there any legitimate use for bit manipulation hacks in higher-level languages such as Java? I can see them being useful in speed-sensitive low-level and computation-intensive programs, e.g. ...
25
votes
9answers
2k views

Is template “metaprogramming” in Java a good idea?

There is a source file in a rather large project with several functions that are extremely performance-sensitive (called millions of times per second). In fact, the previous maintainer decided to ...
-1
votes
1answer
98 views

get all the combination of a given set of numbers [duplicate]

I m trying to get the possible combinations of a given set of numbers say for example 123 The possible combinations would be 123 132 213 231 312 321 For this i have written a code as below - ...
23
votes
4answers
4k views

How to significantly improve Java performance?

The team over at LMAX have a presentation about how they were able to do 100k TPS at less than 1 ms of latency. They have backed up that presentation with a blog, technical paper (PDF) and the ...
0
votes
1answer
180 views

Using JDBC to asynchronously read large Oracle table

What strategies can be used to read every row in a large Oracle table, only once, but as fast as possible with JDBC & Java ? Consider that each row has non-trivial amounts of data (30 columns, ...
1
vote
1answer
82 views

In general: guard pages or heap checks? [closed]

I would like to know the advantages and disadvantages of using guard pages with bump-pointer allocation versus heap checks with bump-pointer allocation, including performance as a consideration. In a ...
0
votes
1answer
115 views

Power of 2 and performance in SQL Server

Many mathematical operation (such as division, multiplication, etc.) are supposed to be computed faster when dealing with power of two numbers (C++, C#?, ...) For instance 15 * 256 = 0x0e right ...
11
votes
4answers
312 views

Database design - Store state or compute state every time?

Let's say I have a relational database application and a "user" object and a "message" object. Now I want to show the number of unread messages to this user. What's the best way to archive this? Do I ...
0
votes
2answers
146 views

Is there a downside to using AggressiveInlining on simple properties?

I bet I could answer that myself if I knew more about tools to analyze how C#/JIT behaves but since I don't, please bear with me asking. I have simple code like this : private SqlMetaData[] ...
4
votes
5answers
1k 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", ...
-2
votes
1answer
114 views

What is the best way to get a method name in runtime?

Here is a little background of my problem: I implemented a singleton logger class which is being called from several projects. I want to log the name of the class as well as the name of the method ...
102
votes
11answers
20k 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 ...
15
votes
1answer
9k views

What is the difference between btree and rtree indexing?

I've noticed on MySQLWorkbench that you can choose how to store your indexes before forward engineering your design. The storage types are: BTREE RTREE HASH Researching this, I found some ...