Optimizations

Premature and/or over-optimization is often claimed to be a root of most evil in the programming world. However, what to do when optimization IS necessary?

IT Hares discuss certain not-so-trivial optimization techniques. It doesn’t mean that you should use them at all costs (and most likely, you don’t); however, if you do have a reason to optimize – this information may be handy.

Allocator for (Re)Actors with Optional Kinda-Safety and Relocation

August 15, 2017 by “No Bugs” Bunny

Effects of External Fragmentation on Memory Usage

Quote:

Safe with relocation’ mode will allow us to eliminate dreaded ‘external fragmentation’ – which tends to cause quite a bit of trouble for long-running systems

Another Quote:

For a long while, I have been a strong proponent of message-passing mechanisms over mutex-based thread sync for concurrency purposes

Filed under: On.System Architecture(Re)ActorsOn.ProgrammingOptimizations

Read more

Ultra-fast Serialization of C++ Objects

May 16, 2017 by “No Bugs” Bunny

serialization: per-field vs whole struct

Quote:

in both these cases we can be 100% sure that we’ll be deserializing this state on the executable which is identical to the executable which serialized the state.

Another Quote:

Even when comparing with home-grown code with per-field serialization, our Ultra-Fast Serialization still wins (up to 1.5x-2x)

Filed under: On.ProgrammingTips and TricksOptimizations

Read more

Some Big-Os are Bigger Than Others

February 21, 2017 by “No Bugs” Bunny

how to weigh 780 kilos as equal to 1 kilo

Quote:

Strictly speaking, for real-world computers, every algorithm which completes in a finite time can be said to be O(1)

Another Quote:

now the difference because of unfortunate ‘jumps’ over (uncached at the time) memory can lead to a 100x+ (!) performance difference. However, it is still O(1) and is rarely taken into account during performance analysis

Filed under: On.ProgrammingOptimizations

Read more

Infographics: Operation Costs in CPU Clock Cycles

September 12, 2016 by “No Bugs” Bunny

Operation costs in CPU clock cycles on x86/x64 Platform

Quote:

Back in 80s, it was possible to calculate the speed of the program just by looking at assembly.

Another Quote:

keep in mind that these days compilers tend to ignore inline specifications more often than not

Filed under: On.ProgrammingOptimizations

Read more