Lecturas #1: Optimization

Retomo el blog con algo sencillito que me apetece compartir. Una serie de lecturas (artículos de blogs, capítulos de libros, whatever) que me hayan gustado en torno a una temática relacionada con el desarrollo de software. Esta vez toca optimizar un poquito el código (o quizás no 😉 ).

Naturally, the numbers above refer to the relative performance of the team in delivering on business goals.

  • Infographics: Operation Costs in CPU Clock Cycles (Blog IT Hare): Bajamos hasta las entrañas de nuestro software y nos hacemos a la idea de lo que tardan cosas como una división entera (más que una en coma flotante), acceder a datos de las caches de la CPU o el cambio de contexto de un thread. Especial atención a primtivas de C++.

Whenever we need to optimise the code, we should profile it, plain and simple. However, sometimes it makes sense just to know ballpark numbers for relative costs of some popular operations, so you won’t do grossly inefficient things from the very beginning (and hopefully won’t need to profile the program later 🙂 ).

  1. Choose the right language
  2. Keep it all in memory
  3. Keep data and processing colocated
  4. Keep the system underutilized
  5. Keep context switches to a minimum
  6. Keep your reads sequential
  7. Batch your writes
  8. Respect your cache
  9. Non blocking as much as possible
  10. Async as much as possible
  11. Parallelize as much as possible

Hasta la próxima 😉

¿Opiniones, comentarios, críticas? :)