Removing the need to allocate here and instead iterate over the tx directly improves performance slightly.
In D15552, in the WS loop, applying this diff sped it up to 850.29s from 969.39s when resyncing the first 300000ish blocks. This loop is now removed when empty, but we can predict a similar improvement of 150s-300s based on that benchmark for GroupHistoryWriter and GroupUtxoWriter.