optimized generated code for partition sender