Top "Micro-optimization" questions

Micro-optimization is the process of meticulous tuning of small sections of code in order to address a perceived deficiency in some aspect of its operation (excessive memory usage, poor performance, etc).

Do java finals help the compiler create more efficient bytecode?

Possible Duplicate: Does use of final keyword in Java improve the performance? The final modifier has different consequences in java …

java optimization micro-optimization
Java - Declaring variables in for loops

Is declaring a variable inside of a loop poor practice? It would seem to me that doing so, as seen …

java micro-optimization
Does using xor reg, reg give advantage over mov reg, 0?

There're two well-known ways to set an integer register to zero value on x86. Either mov reg, 0 or xor reg, …

assembly x86 micro-optimization
How should I return multiple variables in a function (for best practices)?

Just curious to know what the best practice would be for something like this: A function, that returns multiple variables …

php micro-optimization
Why are DateTime.Now DateTime.UtcNow so slow/expensive

I realize this is way too far into the micro-optimization area, but I am curious to understand why Calls to …

c# performance micro-optimization
On the use and abuse of alloca

I am working on a soft-realtime event processing system. I would like to minimise as many calls in my code …

c++ memory-management real-time micro-optimization systems-programming
Very fast approximate Logarithm (natural log) function in C++?

We find various tricks to replace std::sqrt (Timing Square Root) and some for std::exp (Using Faster Exponential Approximation) , …

c++ math logarithm micro-optimization sqrt
What's the most efficient way to make bitwise operations in a C array

I have a C array like: char byte_array[10]; And another one that acts as a mask: char byte_mask[10]; …

c performance micro-optimization
How can I unit test performance optimisations in C#?

I'm using an optimised version of Levenshtein's algorithm in some search code I'm building. I have functional unit tests to …

c# unit-testing optimization micro-optimization
DateTime.DayOfWeek micro optimization

First of all: I'm asking this question just for fun and eager to learn. I have to admit I love …

c# performance datetime micro-optimization dayofweek