This is a simple proof of concept https://github.com/larytet/binlog . With caching of the format strings performance increases ~8 fold.