git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] xdiff: reduce indent heuristic overhead

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 3, 2018, 18:14 UTC
Message-ID
<xmqq1sckrxtp.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<72ac1ac2-f567-f241-41d6-d0f83072e0b3@alum.mit.edu>
Michael Haggerty <mhagger@alum.mit.edu> writes:
Show 10 quoted lines
> So if `N ≫ M`, there is necessarily a lot of repetition among the `N +
> M` lines that the hunk could possibly overlay. Specifically, it must
> consist of `floor((N + M)/M)` identical copies of the hunk, plus
> possibly a few leftover lines constituting the start of another repetition.
>
> Given this large amount of repetition, it seems to me that there is
> never a need to scan more than the bottom `M + 1` possible positions [1]
> plus the highest possible position [2] to be sure of finding the very
> best one. In the pathological case that you described above, where `M`
> is 1, only three positions have to be evaluated, not 100.
Nicely analysed.
Previous: Stefan BellerNext: Jeff King
Message 11 of 17 in “fast-import slowness when importing large files with small differences”
  1. Mike HommeyJun 29, 2018
  2. Stefan BellerJun 29, 2018
  3. xdiff: reduce indent heuristic overheadStefan Beller, Jun 29, 2018
  4. Junio C HamanoJun 29, 2018
  5. xdiff: reduce indent heuristic overheadStefan Beller, Jun 29, 2018
  6. Jun WuJun 30, 2018
  7. Michael HaggertyJul 1, 2018
  8. Stefan BellerJul 2, 2018
  9. Michael HaggertyJul 3, 2018
  10. xdiff: reduce indent heuristic overheadStefan Beller, Jul 27, 2018
  11. Junio C HamanoJul 3, 2018
  12. Jeff KingJun 29, 2018
  13. Stefan BellerJun 29, 2018
  14. Ævar Arnfjörð BjarmasonJun 29, 2018
  15. Mike HommeyJun 29, 2018
  16. Ævar Arnfjörð BjarmasonJul 3, 2018
  17. Mike HommeyJul 3, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.