Title: cmp: print verbose diffs as we find them by kov · Pull Request #100 · uutils/diffutils · GitHub
Open Graph Title: cmp: print verbose diffs as we find them by kov · Pull Request #100 · uutils/diffutils
X Title: cmp: print verbose diffs as we find them by kov · Pull Request #100 · uutils/diffutils
Description: I was thinking of ways to further improve the code and began looking at memory usage, as I thought collecting the differences for verbose output could be problematic for larger files. I managed to rework the code to not incur more overhead, and we actually gain a little bit of performance with the lower memory usage. Before this change, we would first find all changes so we could obtain the largest offset we will report and use that to set up the padding. Now we use the file sizes to estimate the largest possible offset. Not only does this allow us to print earlier, reduces memory usage, as we do not store diffs to report later, but it also fixes a case in which our output was different to GNU cmp's - because it also seems to estimate based on size. Memory usage drops by a factor of 1000(!), without losing performance while comparing 2 binaries of hundreds of MBs: Before: Maximum resident set size (kbytes): 2489260 Benchmark 1: ../target/release/diffutils cmp -l -b /usr/lib64/chromium-browser/chromium-browser /usr/lib64/firefox/libxul.so Time (mean ± σ): 14.466 s ± 0.166 s [User: 12.367 s, System: 2.012 s] Range (min … max): 14.350 s … 14.914 s 10 runs After: Maximum resident set size (kbytes): 2636 Benchmark 1: ../target/release/diffutils cmp -l -b /usr/lib64/chromium-browser/chromium-browser /usr/lib64/firefox/libxul.so Time (mean ± σ): 13.724 s ± 0.038 s [User: 12.263 s, System: 1.372 s] Range (min … max): 13.667 s … 13.793 s 10 runs
Open Graph Description: I was thinking of ways to further improve the code and began looking at memory usage, as I thought collecting the differences for verbose output could be problematic for larger files. I managed to ...
X Description: I was thinking of ways to further improve the code and began looking at memory usage, as I thought collecting the differences for verbose output could be problematic for larger files. I managed to ...
Opengraph URL: https://github.com/uutils/diffutils/pull/100
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:dcaa210f-ace5-5f36-43ef-883627ad88d3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | D508:2E0B3C:833130:C16204:6A4E1817 |
| html-safe-nonce | 5f3c72657c6db0d8ef9f52539e6010d6e20d642d6ce719e37bd8cd578c8caf93 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTA4OjJFMEIzQzo4MzMxMzA6QzE2MjA0OjZBNEUxODE3IiwidmlzaXRvcl9pZCI6IjMxMDY5OTk5NjgxNDI4NTgyNjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0ad144acbfe9e1b19ec8bcddf16da998ebbfe6667aaf3971d454c471328296e6 |
| hovercard-subject-tag | pull_request:2108812745 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/uutils/diffutils/pull/100/files |
| twitter:image | https://avatars.githubusercontent.com/u/1271291?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/1271291?s=400&v=4 |
| og:image:alt | I was thinking of ways to further improve the code and began looking at memory usage, as I thought collecting the differences for verbose output could be problematic for larger files. I managed to ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/uutils/diffutils git https://github.com/uutils/diffutils.git |
| octolytics-dimension-user_id | 5148717 |
| octolytics-dimension-user_login | uutils |
| octolytics-dimension-repository_id | 341787720 |
| octolytics-dimension-repository_nwo | uutils/diffutils |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 341787720 |
| octolytics-dimension-repository_network_root_nwo | uutils/diffutils |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ea9187571e3edc5f2780f750631138669441ca50 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width