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

Re: [PATCH 0/4] chainlint: improve annotated output

From
Jeff King <peff@peff.net>
Date
Nov 9, 2022, 13:11 UTC
Message-ID
<Y2unEeio8cgmBWCX@coredump.intra.peff.net>
In-Reply-To
<Y2q78ofF8fsAX8XU@nand.local>
On Tue, Nov 08, 2022 at 03:28:34PM -0500, Taylor Blau wrote:
Show 13 quoted lines
> On Tue, Nov 08, 2022 at 07:08:26PM +0000, Eric Sunshine via GitGitGadget wrote:
> > This patch series further improves the output by instead making chainlint.pl
> > annotate the original test definition rather than the parsed token stream,
> > thus preserving indentation (and whitespace, in general), here-doc bodies,
> > etc., which should make it easier for a test author to relate each problem
> > back to the source.
> 
> Very nicely done. The changes all seemed reasonable to me (and, in fact,
> the approach is pretty straightforward -- the diffstat is misleading
> since many of changes are to chainlint's expected output).
> 
> So I'm happy with it, but let's hear from some other folks who are more
> familiar with this area before we start merging it down.

I don't claim to be _that_ familiar with the code itself, but all of the patches look reasonable to me. And most importantly, I dug out the state of my tree from early September (via the reflog) before I fixed all of the chainlint problems on my local topics. The improvement in the output with this series is night and day.

I was a little surprised that using a class in patch 3 would cause such a slowdown. But it's not that hard to believe that the workload is so heavy on string comparison and manipulation that the overloaded string and comparison functions introduce significant overhead. It has been a long time since I've optimized any perl, but I remember the rule of thumb being to minimize the number of lines of perl (because all of the builtin stuff is blazingly fast C, and all of the perl is byte-code).

At any rate, the result you came up with doesn't look too bad. The only risk is that you forgot to s/$token/$token->[0]/ somewhere, and I suspect we'd have found that in running the tests.

So it all seems like a step forward to me.
-Peff
Previous: Taylor BlauNext: Taylor Blau
Message 7 of 11 in “chainlint: improve annotated output”
  1. 0/4 chainlint: improve annotated outputEric Sunshine via GitGitGadget, Nov 8, 2022
  2. 1/4 chainlint: add explanatory commentsEric Sunshine via GitGitGadget, Nov 8, 2022
  3. 2/4 chainlint: tighten accuracy when consuming input streamEric Sunshine via GitGitGadget, Nov 8, 2022
  4. 3/4 chainlint: latch start/end position of each tokenEric Sunshine via GitGitGadget, Nov 8, 2022
  5. 4/4 chainlint: annotate original test definition rather than token streamEric Sunshine via GitGitGadget, Nov 8, 2022
  6. Taylor BlauNov 8, 2022
  7. Jeff KingNov 9, 2022
  8. Taylor BlauNov 10, 2022
  9. Ævar Arnfjörð BjarmasonNov 8, 2022
  10. Eric SunshineNov 8, 2022
  11. Eric SunshineNov 8, 2022

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.