)]}'
{
  "commit": "ddaf1f62e3090335e6973911062a9cf70673c06f",
  "tree": "92071ad9a1ddd7ef6827330296c84e74b7b2c0c1",
  "parents": [
    "a5828ae6b52137b913b978e16cd2334482eb4c1f"
  ],
  "author": {
    "name": "Derrick Stolee",
    "email": "dstolee@microsoft.com",
    "time": "Fri Mar 26 12:38:11 2021 +0000"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Fri Mar 26 14:32:45 2021 -0700"
  },
  "message": "csum-file: make hashwrite() more readable\n\nThe hashwrite() method takes an input buffer and updates a hashfile\u0027s\nhash function while writing the data to a file. To avoid overuse of\nflushes, the hashfile has an internal buffer and most writes will use\nmemcpy() to transfer data from the input \u0027buf\u0027 to the hashfile\u0027s buffer\nof size 8 * 1024 bytes.\n\nLogic introduced by a8032d12 (sha1write: don\u0027t copy full sized buffers,\n2008-09-02) reduces the number of memcpy() calls when the input buffer\nis sufficiently longer than the hashfile\u0027s buffer, causing nr to be the\nlength of the full buffer. In these cases, the input buffer is used\ndirectly in chunks equal to the hashfile\u0027s buffer size.\n\nThis method caught my attention while investigating some performance\nissues, but it turns out that these performance issues were noise within\nthe variance of the experiment.\n\nHowever, during this investigation, I inspected hashwrite() and\nmisunderstood it, even after looking closely and trying to make it\nfaster. This change simply reorganizes some parts of the loop within\nhashwrite() to make it clear that each batch either uses memcpy() to the\nhashfile\u0027s buffer or writes directly from the input buffer. The previous\ncode relied on indirection through local variables and essentially\ninlined the implementation of hashflush() to reduce lines of code.\n\nHelped-by: Jeff King \u003cpeff@peff.net\u003e\nHelped-by: Junio C Hamano \u003cgitster@pobox.com\u003e\nSigned-off-by: Derrick Stolee \u003cdstolee@microsoft.com\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0f35fa5ee47c5280b73c945a0043dea439917eb5",
      "old_mode": 33188,
      "old_path": "csum-file.c",
      "new_id": "7510950fa3e99dbbf147ffc5d444d4570a7be23c",
      "new_mode": 33188,
      "new_path": "csum-file.c"
    }
  ]
}
