Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Slightly off topic, but one great way to diff is to compress the new file using the old file as a dictionary. Both zlib and zstd support this (but zlib is limited to a 32KB file).

You can tune how much CPU you want to spend getting a better diff by adjusting the compression ratio, the compressor is well tuned for speed and is generally more efficient than a diffing algorithm, it can find repetitions in the new content, and you get entropy coding.



That's really neat, do you maybe have any links on this?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: