Optimization is the process of improving an existing program to make it work more efficiently or/and using less resources.

learn more… | top users | synonyms (1)

2
votes
0answers
60 views

Can fast, optimized server calls collapse a server?

I've followed a series of optimizations to make our APIs faster. We microoptimized a lot of PHP code to faster, native methods, we unsed variables where they were not being used anymore, and basically ...
9
votes
3answers
2k views

My algorithm that extracts the largest box that can be made from smaller boxes, is too slow

Imagine a cube based world (such as Minecraft, Trove, or Cube World) where everything is made up of identically sized cubes and all the cubes are of the same kind. The goal is to represent the world ...
-3
votes
0answers
32 views

Basic principles to follow for reducing the size of an iOS application [closed]

In my office we have an iOS app which is 60MB in size. I am now the new maintainer of this project and I think I should be able to reduce the size of the app through some optimizations. What are the ...
3
votes
2answers
46 views

Reducing a sequence of array modification operations (insert, sort, replace, remove)

Given a plain array of values, e.g. ["Apple", "Orange", "Banana", "Strawberry"] and a list of operations from the set of [insert, delete, sort and replace], e.g. [ {cmd: "insert", index: 2, ...
3
votes
2answers
81 views

Work out which parcel deliveries we ship ourselves and which we outsource

Firstly, I hope I'm asking this in the right place. I work for a large online retailer in UK. We ship approaching 2000 orders each day and are growing very quickly. We currently use multiple delivery ...
0
votes
0answers
36 views

Approaches to combinatorial optimization problem

Problem I have the following combinatorial optimization problem: A set of applications need to be distributed among a set of nodes. Each node has a capacity and each application has a required ...
0
votes
0answers
21 views

Feasible solution on the constructions phase of GRASP

I am learning about the GRASP (Greedy Randomized Adaptive Search) meta-heuristics. From what I understood, GRASP is based on two main phases. The first one: Construct a initial solution based on ...
3
votes
1answer
63 views

Is serving a single document from a server to a browser slower than serving multiple documents?

I was looking into how to optimize web pages and the biggest way (code-wise) to optimize a website is to reduce the number of requests a browser has to make to your web server to get the full page. ...
6
votes
2answers
139 views

Algorithm for comparing hundreds of similar, but not identical documents

I have seen similar questions about text comparison, but none on such a large scale. I have a client with two sets of recordings of speeches, 250 and 550 recordings each. Each of the recordings in ...
2
votes
0answers
33 views

Optimizing trigram look ups with wildcards

I am working on creating a spell-checking service for Android (note: this is a platform- and language-neutral question) for Asturian, a minority Romance language. We're using hunspell as the base but ...
0
votes
0answers
54 views

Does loop unrolling on a JIT platfrom (.NET or JVM) provide any benefit

I know in C, you can use loop unrolling (unwinding) to help reduce branching in your code but at the expense of program size. That seems to work when you compile to a target machine, however, does it ...
1
vote
1answer
131 views

Compile new JVM language down to Java or JVM bytecode? [closed]

I am making a new hobbyish programing language and want to target the JVM. Do I lose any optimization opportunity if I choose to compile my language down to Java instead of the JVM bytecode?
12
votes
1answer
181 views

Why is Haskell unable to avoid repeated evaluation without the monomorphism restriction?

I just finished learnyouahaskell the other day, and I was trying to make sense of the Monomorphism Restriction, as described by the Haskell Wiki. I think I understand how the MR can prevent repeated ...
0
votes
0answers
80 views

Android runtime - does ART miss optimization opportunities over Dalvik?

Is ART a strict improvement over Dalvik, or there are optimizations that an ahead-of-time compiler will miss compared to JIT, but Google decide they don't matter in practice? For example, with JIT, ...
6
votes
6answers
640 views

performance versus reusability

How can I write functions that are reusable without sacrificing performance? I am repeatedly coming up against the situation where I want to write a function in a way that makes it reusable (e.g. it ...
12
votes
2answers
464 views

Ant colony algorithm

I am a student working on an ant colony simulator for a course project. The algorithm for it is (obviously) an ant colony algorithm. I know there are various forms of the algorithm but all of those ...
1
vote
1answer
184 views

Different Implemenations of Tail Call Optimisation

I've heard some people in my university discuss the tail call optimisation in ML as if it were a special version tail call optimisation. Does the ML (SML/F#) implementations of tco in these languages ...
0
votes
0answers
49 views

How do we know how good a LLVM pass is?

Is there a set of benchmarks or some specific method to evaluate LLVM passes against a criteria, such as performance, memory usage, power consumption, etc? How do we know if the improvement proposed ...
18
votes
6answers
588 views

How does branch prediction work, if you still have to check for the conditions?

I was reading the popular answer about Branch Prediction from http://stackoverflow.com/q/11227809/555690, and there is something confusing me: If you guessed right, it continues on. If you ...
1
vote
1answer
253 views

How to merge two functions that do same things with different variables

I have these two Javascript functions that are equal except for the variables onClickVoteUp: function (e) { var $target = $(e.target); var upvoted = this.model.get("upvoted"); var ...
1
vote
2answers
153 views

Do today's modern compilers perform run time checks?

This is regarding compilers. Do compilers perform run time dependency checks to decide to vectorize a loop ? In other words, do compilers trace through the logic as it would in run-time to ...
1
vote
0answers
65 views

A fast algorithm for a simple multi-objective minimization?

I have a set of n (arbitrary) integer numbers S which I want to partition into k subsets S_i each of size n/k (you can assume that k divides n). Let A be the arithmetic mean of elements of the set S. ...
2
votes
0answers
64 views

Loop Unfolding and Named Significant Bits

I've been writing a Parser Compiler for the last seven or so years, and I recently got to the point (yet again, never satisfied) of structuring the portion dealing with the portions of the language ...
1
vote
2answers
92 views

When, if ever, are basic concurrency optimizations generally made?

Lets say I need to preform the following computationally intensive task For i in range(100000000): doComplexCalculationWithNoSideEffects(i) Most people I talk to tell me that basically any ...
1
vote
1answer
54 views

One Script file or Multiple Script Files [closed]

I have a moderately long(for me at least) bash script file that that maintains a list of LAN users and the bandwidth each one uses. It is 199 lines with 11 functions and is already calling 3 different ...
1
vote
2answers
77 views

Should benchmarks (to compare processors performance) be compiled with optimization CFLAGS?

I need to compare performance of 2 processors and I concluded I should benchmark then with several various tests. I'm currently using linpack (HPL) (because it's still well known and used for ...
3
votes
2answers
103 views

get All data vs get partial data Optimization

Let's say a client makes a GET call to the server to get all the followers of some user. now the client shows a list of all the followers but the only data the list needs is: {"username" : "user", ...
3
votes
1answer
109 views

Deciding How To Split Up Architecture Using If Blocks

I'm having trouble deciding the best way to handle splitting up if block checks for different architectures. I may be handling the scenario completely wrong, so let me know if that is the case, or if ...
1
vote
1answer
279 views

In C#, performance wise, an object's size does matter when you access one of its members through a reference?

It may be a stupid question but in C#, performance wise, an object's size or complexity does matter when you access one of its members through a reference? Or only that specific member is all that ...
1
vote
2answers
220 views

When should we work on GC optimization?

So, I've learnt about how GC works and how can I monitor it via VisualVM, but my question is about why we should ever perform GC optimization? In our web project (JSF/Spring/Hibernate) we haven't ...
8
votes
4answers
425 views

Maintenance cost of SIMD programming code base

Question: The software industry's consensus is that clean and simple code is fundamental to the long-term viability of the code base and the organization that owns it. These properties lead to lower ...
2
votes
3answers
147 views

Best approach for storing huge data

I'll be handling 300,000+ users. Each user (after logging in) will be able to create lets say "folders", in each folder, users will create "name=value,name2=value2,name3=value3" entry pairs. Each name ...
0
votes
1answer
1k views

Designing a scalable schema for college database [closed]

I am trying to build back end for college ERP system. The system will be based on LAMP. These is the scenario: Colleges have 5 branches There are 4-6 classes in each branch. There are 80 students ...
1
vote
0answers
151 views

Algorithm for sport tournament bracket tree

I would like to develop a library that: receive n players in input response with the tournaments brackets in output. I would ask you what kind of algorithm I have to use to choose the correct tree ...
1
vote
0answers
76 views

Multiple API Calls on Web Server

I am trying to build a Tumblr Site that makes API calls to Social Network sites and return data and render on the Tumblr Site. And the thing is Tumblr doesn't allow PHP on their HTML Editor. So my ...
1
vote
1answer
158 views

Which algorithm best fits the following problem [closed]

I'm looking for the right algorithm to solve a specific problem. I hope that there are known algorithms that can be used. The problem definition Given a set of 'options' (~10) A session is defined ...
2
votes
2answers
166 views

Do we really need auto-vectorization?

I am trying to understand automatic parallelization and a special case of that is auto vectorization. As I understand it auto-vectorization is more or less: The compiler takes parts of the code which ...
2
votes
1answer
323 views

Quickest sorting algorithm for sorting a low number of integers

I am making a program on my spare time that I want to run as quickly as possible. The program is written in C. A large set of the procedures operate on pointers to 7 integers that are sorted by their ...
2
votes
2answers
205 views

How can I get better than O(N^2) space complexity for a type sequence search?

Suppose I have a type sequence through which I want to search: template <typename...> struct TypeSequence { using type = TypeSequence; }; I want to create a metafunction Search that returns ...
3
votes
1answer
53 views

How to diversify an optimal solution set?

If given a list of players, their salaries, and their projections, one can easily find the top 'n' projected teams (where a team is a combination of players), such that every team is under the salary ...
-1
votes
2answers
225 views

Does GCC optimize code to remove useless variable read operations? [closed]

I'm using GCC on ununtu 14.04. My program is written in c++ and in a case i need to check the amount of time the program needs to read a large integer array. what is the best way to do this without ...
2
votes
1answer
327 views

Do compilers un-inline recurrent expressions?

Does a compiler look for recurrent expressions to convert it into 'function' to reduce binary size and improve performance? Of course, the obvious answer might be "some do it, some don't", so I ask ...
0
votes
0answers
98 views

What Algorithm can be use for task allocation based on location?

What algorithm can be use for task scheduling based on location? For example there are 100 students and 5 lecturers available. Each lecturer must get same amount of student using location allocation ...
1
vote
2answers
581 views

Calculating NPath Complexity

I'm trying to calculate the NPath Complexity within a function, but I'm unsure what parts I count. My understanding is that it'll sum: If Else Else If Switch Case Default Do While Is this ...
4
votes
1answer
646 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 ...
7
votes
6answers
1k views

Why don't compilers inline everything? [closed]

Sometimes compilers inline function calls. That means that they move the code of the called function into the calling function. This makes things slightly faster because there's no need to push and ...
1
vote
2answers
227 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
1answer
108 views

Finding a way to simplify complex queries on legacy application

I am working with an existing application built on Rails 3.1/MySql with much of the work taking place in a JavaScript interface, although the actual platforms are not tremendously relevant here, ...
2
votes
3answers
622 views

Best practices for geolocation

We are writing a flight search engine. We want to pre-fill the departure airport for mobile users with the closest one to their location. To do that, our plan is to Find a list of airports with ...
2
votes
4answers
181 views

Optimizing code by using registers, but what if they are not enough in number?

One way to optimize code is to minimize the access to arrays and use variables instead, because that way we use registers instead of loading data to cache memory. For example, if in a loop I'm going ...