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

[GSOC][QUESTION] How to parse the properties of the object at once

From
ZheNing Hu <adlternative@gmail.com>
Date
Aug 7, 2021, 06:32 UTC
Message-ID
<CAOLTT8Q8BEKCVwPDypW1w66P9_xP7QC0T-CnLqamqAL4haGzwA@mail.gmail.com>
Hi guys,

parse_object_buffer() which will call parse_tag_buffer() and parse_commit_buffer() to parse object data and store in `struct tag` and `struct commit`, which can directly obtain the parsed data later by something like grab_tag_values() and grab_commit_values().

But parse_object_buffer() will only parse part of the object data, so that we need some additional parsing like grab_person() and grab_sub_body_contents() in ref-filter. It is a repetitive parsing and will affect performance.

So I am thinking if we can add some members in `struct commit` or `struct tag`, so that we can get more different types of data in the parsing process.

At the same time, these parsing are optional, which means that we can set several hook pointers to decide whether we need this type data, like oid_object_info_extended() does, in this way we will not bring a lot of performance loss when we don't need them.

But I find in commit.h, there is such a comment:
/*
 * The size of this struct matters in full repo walk operations like
 * 'git clone' or 'git gc'. Consider using commit-slab to attach data
 * to a commit instead of adding new fields here.
 */

This means that I shouldn't touch the content of struct commit. So I see the code of `commit-slab`, it seems that it is doing additional parsing. But what I hope is that let parse_commit_buffer() can parse commit data only once.

In addition, I am thinking about whether to build a huge "struct object_view" to store the parsed objects' properties states and results.

Any good ideas? -- ZheNing Hu

Next: Junio C Hamano
Message 1 of 2 in “[GSOC][QUESTION] How to parse the properties of the object at once”
  1. ZheNing HuAug 7, 2021
  2. Junio C HamanoAug 7, 2021

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.