#2385 Make patch_to_diff use lists instead of string concatenation
Merged by pingou. Opened by puiterwijk.
puiterwijk/pagure fixslowness  into  master

Download 2385.patch

String concatenation is very inefficient in Python (and most languages) due to
the constant reallocation of the same memory block.
Instead, let's just build up the full diff in a list of strings, which we then
concatenate in a single time.

On my laptop, this speeds up the viewing of a particular semi-large diff from
over three minutes to just two seconds.

Signed-off-by: Patrick Uiterwijk puiterwijk@redhat.com

Nice!

Thanks :)

Pull-Request has been merged by pingou

Metadata