Improved write performance by using iolist_to_binary(BinA, BinB) instead of <<BinA/binary, BinB/binary>>. Thanks @eproxus for the suggestion.