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)

11
votes
6answers
7k views

is it realistic to make use of HTML5 local storage to store CSS, and JavaScript

The idea is to make use of HTML5 local storage to store frequently accessed CSS and JavaScript. For example (pseudo-code): var load_from_cdn = true; if (detect local storage) { if (cache of ...
7
votes
4answers
2k views

How important are PHP notices really?

I recently turned all possible error-messages on with error_reporting(-1);, on my PHP project. Of course, right away I got alot of messages. For example: Notice: Undefined variable: foo in ...
4
votes
3answers
226 views

How to best approach planning and budgeting of software performance optimization efforts?

There is a software system that has been with the client for some time now. If is feature-rich, mature, complex enterprise application that client uses in production. Due to the rapid expansion of the ...
6
votes
8answers
1k views

How important is it for a programmer to know how to optimize code, solve complex puzzles, answer technical questions quickly?

So I'm in the process of looking for a job. And I have had plenty of test and just recently someone sent me a puzzle. It's the crackless wall problem and I have no idea how to approach it. I could ...
114
votes
30answers
10k views

Is micro-optimisation important when coding?

I recently asked a question on Stack Overflow to find out why isset() was faster than strlen() in PHP. This raised questions around the importance of readable code and whether performance improvements ...
2
votes
2answers
477 views

How is switch/case handled as to avoid comparisons to the case values?

I've read in multiple answers that switch/case avoids "unnecessary" comparisons, but I never learned this in college, and I'm a little stumped on how the program would figure out which case to jump to ...
8
votes
2answers
7k views

elevator algorithm and implementation

I wanted to know how (real) elevators work. But, so far, I could not find much material about the algorithms they use, nor software (if any) for simulation. Could anybody give me references for that?
3
votes
1answer
238 views

Algorithm visualization app/plugin

I am looking for an application (or and IDE plugin) that I can use in order to test some algorithms I implement. Mainly metaheuristics used in TSP, VRP and other optimization problems. I have already ...
0
votes
2answers
249 views

How can I make my career in supply chain optimisation and data mining? [closed]

There is a company in my city which does supply chain optimization, data mining and predictive modelling. I tried hard but was not able to enter there. Now I want to do similar sort of work. They ...
7
votes
2answers
4k views

Is this a valid smartphone CPU vs. desktop CPU speed comparison (Android G1 vs. old Pentium 4 desktop)?

I am trying to estimate speed differences when creating code on my desktop PC that will be ported to Android phones. I don't need to be exact, but a good estimation will help stop me from creating ...
7
votes
6answers
1k views

Where should code refactoring and optimization fit within both an agile and waterfall process timeline?

There appears to be this notion among the project management team that stating that "it works" means it should then be deemed 100% complete. Most programmers know that isn't always the case. If I'm ...
13
votes
3answers
504 views

Are web best practices so important if they are always violated by large companies?

Usually, there are a bunch of rules and best practices which help optimizing a website, bring new customers, and in general making user experience fast, smooth and pleasant while (sometimes) reducing ...
3
votes
4answers
1k views

Guidelines for HTML/CSS/JS optimization process

Currently we have a Development server on which we write the HTML/CSS/JS code. We do not optimize our code using compressors/minifiers. So our deployment process from Development to Production is ...
6
votes
4answers
205 views

What are some common algorithm optimization opportunities - mathematical or otherwise

What are some common algorithmic optimization opportunities that everyone should be aware of? I have recently be revising/reviewing some code from an application, and noticed that it appeared to be ...
1
vote
3answers
226 views

What are the various premature optimizations traits / types?

For code review technique training, I have to cover various topics. One of them is premature optimization. I found 3 traits of it as: It's generally evil; causing inverse effects. It's an ...
50
votes
9answers
6k views

Clean readable code vs fast hard to read code. When to cross the line?

When I write code I always try to make my code as clean and readable as possible. Every now and then there comes a time when you need to cross the line and go from nice clean code to slightly uglier ...
3
votes
5answers
315 views

Based on what I read in “Inside the Machine”, is this approach to branches more optimal?

So I have been reading Inside the Machine by Jon Stokes. It is a FANTASTIC book, and it has got me thinking about the effects of programming on processors... Given a branch unit in a CPU and a ...
25
votes
3answers
8k views

How fast can Go go?

Go is one of the few languages that are supposed to run 'close to the metal', i. e. it's compiled, statically typed and executes code natively, without a VM. This should give it a speed advantage over ...
65
votes
36answers
6k views

What is the best retort to “premature optimization is the root of all evil” [closed]

Often I hear the sentiment ... "Why worry about performance, write slow code, get your product to market ... don't worry about performance. You can sort that out later" The culmination of this ...
56
votes
16answers
2k views

Why should I care about micro performance and efficency?

Many questions and answers on the C/C++ pages, specifically or indirectly discuss micro performance issues (such is the overhead of an indirect vs direct vs inline function), or using an O(N2) vs ...
5
votes
5answers
333 views

An alternative to requiring red in TDD: reverting code change?

According to this answer to this question, a good reason for always starting with a failing test ("Red") is to make sure that the test is working and that the code that will be written is what makes ...
7
votes
4answers
566 views

Computational intensive application: loading vs. querying database

My company has a suite of mature (roots go back 15+ years), computationally intensive applications (simulations) which we use to do consulting work. I work on the simulation/consulting side of the ...
20
votes
6answers
1k views

Does the advent of the SSD have any implication for database optimization?

Today I was browsing through a book on SQL Server optimization and it seemed that a certain amount of the ideas were based on a linear model of storage. As SSDs have a completely different storage ...
12
votes
4answers
2k views

NP complete or NP hard problems in real life

Does anybody have real life examples where they regularly solve NP complete or NP hard problems (by heuristics, or chasing a suboptimal solution or whatever) in their job? I know they occur in ...
1
vote
1answer
93 views

Optimizing programs by identifying and taking evaluation (calculation) shortcuts

Recently I am working on a project that involves a lot of simple numerical calculations being applied to large arrays. The numerical values are very simple but there are many different types, such as ...
2
votes
2answers
241 views

Server requests optimisation - size vs frequency

my map-like app loads data from google map API but it also loads some extra data - in the form of XML - from my server. When the app loads it really needs only small amount of data to cover the ...
5
votes
4answers
513 views

How does optimization make code “greener”?

It seems clear that whatever the language used, an optimized application consumes fewer resources than a poorly written application, and require fewer servers to manage a similar number of requests ...
19
votes
10answers
621 views

Is it always wrong to optimize before profiling?

I see the mantra of "profiling before optimization" repeated again and again here, on SO, and elsewhere. Although I certainly use profiling tools, I'm only occasionally surprised by the results. It ...
5
votes
6answers
615 views

Are there jobs which are oriented towards optimisation programming or assembly

3D engine programmers have to care a little about execution speed, but what about the programmers at ATI and nVidia ? How much do they need to optimize their driver applications ? Are there jobs out ...
6
votes
8answers
360 views

How often is software speed evident in the eyes of customers?

In theory, customers should be able to feel the software performance improvements from first-hand experience. In practice, sometimes the improvements are not noticible enough, such that in order to ...
8
votes
10answers
328 views

Where do you optimize?

There are two areas to possibly optimize for speed in: Where the most time is spent The code that is called the most Which is the best place to start optimizing? Often code that is called the ...
7
votes
8answers
1k views

Is premature optimization always bad? [duplicate]

I work in a small sized software/web development company. I have gotten into the habit of optimizing prematurely, I know it is evil and promotes bad code, but I have been working at this firm for a ...
29
votes
16answers
3k views

Should you sacrifice code readability with how efficient code is? [closed]

Should you sacrifice code readability with how efficient code is? e.g. 3 lines of code into 1 line. I read in Code Craft by Pete Goodliffe that readability is key. Your thoughts?
2
votes
3answers
2k views

How do you find the most optimized way to write code?

In my programming career, I have written Java and PHP, Javascript and a little Ruby. I am not a CS major but got into web development from a more broad Internet Professional associates degree, which ...
38
votes
9answers
2k views

When is optimization not premature and therefore not evil?

"Premature optimization is root of all evil" is something almost all of us have heard/read. What I am curious what kind of optimization not premature, i.e. at every stage of software development (high ...
4
votes
2answers
125 views

How much configurability to give to users regarding concurrency?

This question is a narrowing-down of these related questions: How much effort should we spend to programming for multiple cores? Concurrency: How do you approach the design and debug the ...
14
votes
5answers
7k views

JIT compiler for C, C++, and the likes

Is there any just-in-time compiler out there for compiled languages, such as C and C++? (The first names that come to mind are Clang and LLVM! But I don't think they currently support it.) ...
8
votes
2answers
401 views

How big sites scale up and optimize to massive traffic? [closed]

How do sites like Facebook and Twitter optimize their sites for massive traffic. Aside from spending big bucks on getting the best servers, what can be optimized in your code to accommodate massive ...
17
votes
18answers
741 views

What do you optimize for? [closed]

Generally speaking, what type of optimizations do you typically slant yourself towards when designing software? Are you the type that prefers to optimize your design for Development time (i.e., ...
9
votes
2answers
1k views

Compiler optimization examples [closed]

I'd like to see (good) examples of optimizations performed by compilers (static and JIT). Why? To learn what we don't have to optimize ourselves (often leading to better code) To be amazed
14
votes
7answers
255 views

What optimizations are premature? [duplicate]

I've been here for nearly a month and it seems that people have a tendency to be eager to use the "Premature Optimization is the root of all evil" argument as soon as someone mentions efficiency. ...
75
votes
16answers
14k views

Is premature optimization really the root of all evil?

A colleague of mine today committed a class called ThreadLocalFormat, which basically moved instances of Java Format classes into a thread local, since they are not thread safe and "relatively ...