Closed joshuarli closed 4 years ago
Thank you. I will take a closer look as soon as possible. The function was from another contributor, I am also worried about the readability. Of course performance enhancement is very good, would you mind share with me how did you measure the performance?
Thank you. I will take a closer look as soon as possible. The function was from another contributor, I am also worried about the readability. Of course performance enhancement is very good, would you mind share with me how did you measure the performance?
https://github.com/joshuarli/ydiff#Performance
I just used git log --patch
on a large repo to generate a massive unified diff (500+ MB) and ran a profiler to inspect hot loops. I don't have those screenshots anymore, unfortunately, but I used the heatmap generated by https://github.com/nvdv/vprof.
Thank you. I have some small nitpicks but I will clean myself later, together with some other simplification I planned.
Hi @ymattw, thanks for writing ydiff, I find it to be very useful and I see you've become active again.
I have a rather substantially modified fork of it, and managed to identify and optimize a very hot loop. This is an adaptation of https://github.com/joshuarli/ydiff/commit/e6c4a3e5f87923a791b3da52c57af8468f123b99.
In practice I've found roughly a 2x speedup: https://github.com/joshuarli/ydiff#Performance
Granted, the speedup is only really noticeable if you're rendering extremely large diffs.