diff: use BytesIO over bytes for performance reason

3 jobs for branch/default in 1 minute and 56 seconds (queued for 1 second)