diff icon indicating copy to clipboard operation
diff copied to clipboard

Performance issues when generating a diff for specific files

Open codebymikey opened this issue 1 year ago • 0 comments

There are some noticeable performance issues when generating a diff for specific files. This Drupal yaml file in particular took about 70-80 seconds to generate a diff for.

There's some performance bottleneck somewhere in the algorithm since doing the same diff using other diffing tools like jsdiff and diffutil's diff command yields the result a lot faster.

I've created a repository for demo purposes: https://github.com/codebymikey/diff-performance-demo

Comparing the performance difference of the shell command and the library.

Sample output from running the script:

Method: shell
Duration: 0.0052549839019775
Output size: 8381
==============================
Method: php-jfcherng
Duration: 0.015406131744385
Output size: 8395
==============================
Method: php-sebastianbergmann
Duration: 27.506828069687
Output size: 8395
==============================

codebymikey avatar Oct 23 '24 10:10 codebymikey