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

learn more… | top users | synonyms

0
votes
3answers
128 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
115 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
7 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
207 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) { ...
3
votes
1answer
161 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
306 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 ...
1
vote
1answer
385 views

Is there a module for writing low level code on Python?

Can you manipulate bits and memory directly using Python? If yes, wouldn't that be a best option to dealing with performance-critical spots than C bindings?
3
votes
3answers
188 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> ...
16
votes
4answers
517 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
368 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 ...
0
votes
2answers
92 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 ...
0
votes
1answer
65 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
138 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
78 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 ...
1
vote
0answers
221 views

Using local variable assigned to return value of a function or using function directly [migrated]

Is there a difference between this: MyClass c = getMyClass(); calculate(c.value); and this: calculate(getMyClass().value); in the scope of performance and memory allocation?
0
votes
1answer
103 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
302 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
102 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
84 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 ...
0
votes
1answer
93 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 ...
98
votes
11answers
18k 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
8k 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 ...
1
vote
1answer
112 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 ...
7
votes
5answers
966 views

Why did the team at LMAX use Java and design the architecture to avoid GC at all cost?

Why did the team at LMAX design the LMAX Disruptor in Java but all their design points to minimizing GC use? If one does not want to have GC run then why use a garbage collected language? Their ...
3
votes
1answer
302 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 ...
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 ...
1
vote
2answers
76 views

Which is more expensive multiple conditional branches or multiple relational expression in a single condition?

Which is more expensive in terms of processing costs if ( x < 20 && z == "M") { // statements 3 } if ( x >= 20 && w && x <= 65) { // statements 1 } if( x ...
2
votes
2answers
114 views

How faster could a dedicated chip do sequential squaring modulo operations to break a time crypto capsule?

I'm facing a very real problem and, sadly, I cannot find the answer on my own: I'm hitting my limit as a programmer because my hardware knowledge is not sufficiently advanced at all. It's an issue ...
7
votes
5answers
2k 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 ...
16
votes
12answers
6k 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 ...
1
vote
2answers
159 views

Polling vs events pros and cons in JavaScript

I'm bit of a novice to JavaScript so I've been wondering on positive and negative sides of using polling compared to using events in JavaScript? When does one use one or the other? By polling I ...
3
votes
1answer
343 views

Specifically for JS, CSS, HTML: what is the difference between optimization, compression, minification, tidying, concatenation?

When we talk about source code and the file which contains the code like CSS, HTML, JavaScript and we also talk about performance of a web site or application, what is the differences between these ...
0
votes
2answers
102 views

How should I create object after database insert PHP

I have just been working on a new project and doing things the same way I have for years now. However for the first time, I am constantly thinking about scalability and performance of both the ...
0
votes
2answers
175 views

foreach in list or foreach in list.where [duplicate]

I don't know what to call this question. This is my example: foreach (var item in lstItem.Where(item => stock.ItemCode == item.ItemCode)) { stock.ItemName = item.ItemName; ...
20
votes
7answers
3k views

Writing in C for Performance? [closed]

I know I have quite frequently heard that C typically has a performance advantage over C++. I didn't really think anything else of it until I realized that MSVC doesn't even seem to support the newest ...
0
votes
3answers
172 views

comparison of floating point numbers vs. comparsion of Integers in C [closed]

Does comparison of floating point numbers takes (considerably) longer time than comparison of Integers in C? I just wrote a C program of heap sort to sort floating point numbers. I am on ubuntu ...
1
vote
1answer
182 views

alternate approach of binary serialization/de-serialization

Is it possible to convert a list of object directly to byte[] (and vice versa) to gain performance (by avoiding serialization/de-serialization)? What I have in mind is that a list is somewhere in ...
1
vote
3answers
450 views

Is there a performance difference between ++x over x++? [duplicate]

Is there a performance difference between using ++x over x++ increment operators? I've see developers use ++x in loops where I would normally write x++ out of habit. For example; for(int x=0; x ...
10
votes
7answers
391 views

When to start thinking about scalability? [closed]

I'm having a funny but also terrible problem. I'm about to launch a new (iPhone) app. It's a turn-based multiplayer game running on my own custom backend. But I'm afraid to launch. For some reason, I ...
-4
votes
2answers
331 views

True/false on the left or the right? [duplicate]

I have heard that generally, an expression like: if (true === $variable) is faster than: if ($variable === true) My question is about the performance, not the readability. Questions such as this ...
0
votes
7answers
3k 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
1answer
88 views

Performance of One API vs Multiple API's

I was having a conversation with a colleague and although my opinion makes sense to me, I wasn't able to back it up. I'm in the process of creating an API that will be hit hundreds of thousands of ...
0
votes
7answers
757 views

Is there any performance benefit in checking the item count prior to executing a foreach loop?

I saw this in code and was wondering if there is any performance benefit to checking the item count prior to looping: if (SqlParams.Count > 0) foreach (var prm in SqlParams) ...
0
votes
0answers
23 views

How do I implement the OpsDB from Release It! by Michael T Nygard

I have recently been reading the Release It! book by Michael T Nygard.In the book he talks about Implementing an OpsDB to manage and record performance statistics of applications. Has anyone ...
0
votes
2answers
213 views

Can this argument be enough?

We have two C++ classes named Important and Small The class Small use a few methods and attributes from the class Important, but not all. Since our application is performance critical, instead of ...
3
votes
1answer
128 views

Should a stored proc try to do more, in the attempt to avoid php mysql back and forth overhead

I have a REST architecture, running PHP on the server side which store and query a Mysql database. I am re-evaluating one architecture design decision: DECISION to re-evaluate: In an attempt to ...