There are many different types of code optimization when it comes to assembly or assembler code.
There is of course most popular speed optimization that focuses on the fastest possible code, often with use of MMX, SSE, AVX instructions to process as many data as possible.
But there is one particular area of assembly programming that focues on size optimization. I have used this knowledge many times in many of my software reverse engineering projects to modify compiled binaries with a limited amount of space available to include the modified code or to develop shellcodes for 0 day exploits, where again the size of the shellcode is limited.
Full article at: