Improved the performance when sending messages