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).

AVX 512 vs AVX2 performance for simple array processing loops

I'm currently working on some optimizations and comparing vectorization possibilities for DSP applications, that seem ideal for AVX512, since these …

performance x86 micro-optimization avx2 avx512
Improving the Quick sort

If possible, how can I improve the following quick sort(performance wise). Any suggestions? void main() { quick(a,0,n-1); } void …

c performance sorting micro-optimization quicksort
Does the order of case in Switch statement can vary the performance?

Let say I have a switch statement as below switch(alphabet) { case "f": //do something break; case "c": //do something …

c# performance micro-optimization switch-statement
How efficient is an if statement compared to a test that doesn't use an if? (C++)

I need a program to get the smaller of two numbers, and I'm wondering if using a standard "if x …

c++ c if-statement micro-optimization
How can the rep stosb instruction execute faster than the equivalent loop?

How can the instruction rep stosb execute faster than this code? Clear: mov byte [edi],AL ; Write the value in …

performance assembly optimization x86 micro-optimization
C pointers vs direct member access for structs

Say I have a struct like the following ... typedef struct { int WheelCount; double MaxSpeed; } Vehicle; ... and I have a global …

c embedded pointers global micro-optimization
Fast method to copy memory with translation - ARGB to BGR

Overview I have an image buffer that I need to convert to another format. The origin image buffer is four …

c x86 rgb sse micro-optimization
'Correct' unsigned integer comparison

So, we all know the C/C++ signed/unsigned comparison rules where -1 > 2u == true, and I have a …

c++ c assembly type-conversion micro-optimization
How expensive is it to convert between int and double?

I often see code that converts ints to doubles to ints to doubles and back once again (sometimes for good …

c++ x86 c++-cli x86-64 micro-optimization
Is there a performance overhead to a private inner class in Java?

When I have inner classes with private methods or fields the compiler has to create synthetic package-protected accessor methods to …

java performance inner-classes micro-optimization