Since optimization may occur at various stages (analysis, design, implementation, compiler, runtime, etc.) during the development of a program, and according to the FAQ, the following types of questions are certainly valid: What is/is it considered optimization, with a detailed question about what ...
3
votes
6answers
325 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 ...
2
votes
1answer
76 views
File Processing Times
I have a very simple program in Ruby that opens a dictionary file, sorted-words.txt and prints out all the words in pig-latin. I tested its speed, and the first time I ran it, the program finished in ...
0
votes
4answers
373 views
what is best book to learn optimized programming in java [closed]
Possible Duplicate:
Is there a canonical book for learning Java as an experienced developer?
Let me elaborate a little:
I used to be a C/C++ programmer where I used data structure ...
4
votes
4answers
295 views
Efficient methods for storing tens of millions of objects for querying, with a high number of inserts per second?
This is basically a logging/counting application that is counting the number of packets and counting the type of packet, etc. on a p2p chat network. This equates to about 4-6 million packets in a 5 ...
9
votes
5answers
836 views
It takes me hours to completely understand solutions to 1000-pt problems on TopCoder. Should I get discouraged?
Sometimes this applies to the 500-pt ones too. I sometimes start feeling I will never improve enough to code them with ease like the others. Should I just quit? If not, why? It is extremely annoying, ...
3
votes
1answer
132 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?
6
votes
4answers
371 views
Optimization as a branch: is that a thing?
My company has highly optimized scientific application which has become so big and complicated that new versions are literally taking t = infinity to produce. (E.G. I have an email which ...
5
votes
7answers
282 views
How can I organize fast and comfortable solution compilation in VS 2010?
Most of programmers who are involved into development of more or less large project(s) know how annoying the process of compilation can be. There are some other things which are dependent on ...
3
votes
4answers
189 views
What factors should I consider when choosing names for identifiers?
What factors do I need to consider when choosing names for identifiers such as variables? I am concerned about space issues, i.e. extra memory consumption when choosing longer names.
As an example, ...
9
votes
4answers
398 views
Approaches against code base becoming uniformly slow
We are working on a moderately-sized C++ code base (10Mloc) which through our optimization efforts is becoming uniformly slow.
This code base is a set of libraries which we combine to put them to ...
7
votes
4answers
241 views
Is there a general method to evaluate the optimality of an optimization algorithm?
is there a general method to evaluate the optimality of an optimization algorithm, for example an algorithm solving an otherwise NP-hard or NP-complete problem?
The only method I came up so far is ...
4
votes
4answers
691 views
Why is C++ known as 'premature optimizaton'?
"Programming in C++ is premature optimization"
Why does everyone do some people say this?
1
vote
3answers
155 views
Is it possible to embed multiple programs into 1
To be more specific, let me explain my end result goal or more of what I would LIKE to have someday and then you can tell me if its even feasible and if not possibly an alternative method.
I really ...
3
votes
4answers
334 views
How can I learn about optimising for the CPU cache (in C)?
Reading these two questions, I see that understanding CPU caching behaviour can be important when dealing with large amounts of data in memory. I would like to understand the way the caching works to ...
0
votes
1answer
67 views
Branding websites aimed for mobile devices
I'm currently working on a website which is also supposed to be mobile optimized.
My client has provided me with a layout of how the mobile version of how the website should look like. Making their ...
7
votes
4answers
389 views
How to document and teach others “optimized beyond recognition” computationally intensive code?
Occasionally there is the 1% of code that is computationally intensive enough that needs the heaviest kind of low-level optimization. Examples are video processing, image processing, and all kinds of ...
4
votes
3answers
238 views
Which of these algorithms is best for my goal?
I have created a program that restricts the mouse to a certain region based on a black/white bitmap. The program is 100% functional as-is, but uses an inaccurate, albeit fast, algorithm for ...
4
votes
3answers
245 views
CPU Architecture and floating-point math
I'm trying to wrap my head around some details about how floating point math is performed on the CPU, trying to better understand what data types to use etc.
I think I have a fairly good ...
3
votes
1answer
113 views
Include all php files in one file and include that file in every page if we're using hiphop?
I understand that in normal php if we're including a file we're merging the source of it in the script and it would take longer for that page to be parsed/processed but if we're using HipHop shouldn't ...
2
votes
3answers
254 views
Single click handler for all buttons in Javascript? Is it a pattern? Whats the benefit?
I have been told that when there are multiple buttons on the page for same purpose but targeting different item e.g. delete item on a grid of items, they say it is recommended to just register for ...
0
votes
4answers
91 views
The cross-over between designing for performance/pre-mature optimisation [closed]
Possible Duplicate:
When is optimization not premature and therefore not evil?
Whilst designing my own .Net SQL access library, I found that I want everything thing to run as fast as ...
1
vote
2answers
154 views
What is the best way to insert range of values into a datastructure
If I have a datastructure which is the fastest way I could insert values into it in a specified range?
For example if I had a method:
myDatastructure var=new myDataStructure();
var.insert(2,1000);
...
4
votes
1answer
119 views
Why there is no ISO hardware query interface?
I'm currently reading a book, chapter about I/O, and one question came to my mind.
Basically, when you program in C/C++, you have an amazing opportunity to optimize for hardware behavior. Using ...
6
votes
9answers
536 views
How do I know if the compiler broke my code and what do I do if it was the compiler?
Once in a while C++ code will not work when compiled with some level of optimization. It may be compiler doing optimization that breaks the code or it may be code containing undefined behavior which ...
6
votes
2answers
213 views
How do I optimize a web application for high-latency users?
Basically, I have an application that does searches and requests results from a backend via long polling. It connects to the backend which collects results for 500 ms then sends them back to the ...
7
votes
4answers
252 views
Is microoptimization worth it in mobile devices?
Usually microoptimization is considered not worth it with the following explanation: it might speed up the program by less that one percent, but noone cares of that minor boost - that's just too ...
2
votes
3answers
157 views
Is it worth evaluating compiler optimization on trivial cases?
I'm currently testing Visual C++ 10 on some trivial pieces of code. For example, like this one (taken from here):
int main()
{
int i;
clrscr();
...
2
votes
5answers
242 views
Is it an inefficient workflow to write out code and THEN go back and optimize?
I'm a newer enthusiast programmer. I've been doing small and big projects on and off for the past two or three years.
I always hit small snags in my code that add up to big memory hogs or unnecessary ...
7
votes
7answers
768 views
When should I be offloading work to a GPU instead of the CPU?
Newer systems such as OpenCL are being made so that we can run more and more code on our graphics processors, which makes sense, because we should be able to utilise as much of the power in our ...
2
votes
2answers
316 views
How can I best implement 'cache until further notice' with memcache in multiple tiers?
the term "client" used here is not referring to client's browser, but client server
Before cache workflow
1. client make a HTTP request -->
2. server process -->
3. store parsed results into ...
6
votes
6answers
986 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 ...
4
votes
4answers
226 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 ...
2
votes
3answers
124 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
614 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 ...
79
votes
27answers
4k views
Is micro-optimisation important when coding?
I recently asked a question on stackoverflow.com to find out why isset() was faster than strlen() in php. This raised questions around the importance of readable code and whether performance ...
2
votes
2answers
190 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 ...
5
votes
2answers
536 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
204 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 ...
1
vote
2answers
140 views
How can I make my career in supply chain optimisation and data mining?
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
1k 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
302 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
396 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
384 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 ...
5
votes
4answers
101 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
166 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 ...
37
votes
10answers
3k 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
279 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 ...
14
votes
3answers
2k 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 ...
52
votes
34answers
4k views
What is the best retort to “premature optimization is the root of all evil”
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 ...
47
votes
16answers
1k 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 ...