implemented message batching (speedup small messages)