Of course, using "packed" attribute brings some penalties into the code, because it needs to fit those 8 bits back into the 16 bits (or 32 bits, depending of processor), but if the goal isn't code speed, but network packet size efficiency, that's the way to do it. (BTW, the is also the "align" attribute which can be relevant in some cases)
Of course, using "packed" attribute brings some penalties into the code, because it needs to fit those 8 bits back into the 16 bits (or 32 bits, depending of processor), but if the goal isn't code speed, but network packet size efficiency, that's the way to do it. (BTW, the is also the "align" attribute which can be relevant in some cases)