Pruning forces a chainstate flush, which can defeat the dbcache and harm performance significantly.
During IBD we now prune based on the worst case size of the remaining blocks, but no further than the minimum prune size of 550 MB.
Using MAX_BLOCK_SERIALIZED_SIZE
is complete overkill on testnet and usually too high on mainnet. It doesn’t take into account the SegWit activation block either. This causes the node to be further pruned than strictly needed after IBD. It also makes it more difficult to test. One improvement could be to use a moving average actual block size or a hard coded educated guess. However there’s something to be said for keeping this simple.