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

Re: [PATCH v2 5/7] name-hash: perf improvement for lazy_init_name_hash

From
JHJeff Hostetler <git@jeffhostetler.com>
Date
Mar 24, 2017, 12:36 UTC
Message-ID
<89375f59-8716-3ddc-b163-5669452273c5@jeffhostetler.com>
In-Reply-To
<CAGZ79kZKri4jsnGCWhpV_WjSef5DxSwMTxYOour9kjzTWOFcxA@mail.gmail.com>
On 3/23/2017 1:45 PM, Stefan Beller wrote:
Show 17 quoted lines
> On Thu, Mar 23, 2017 at 8:25 AM, Ramsay Jones
> <ramsay@ramsayjones.plus.com> wrote:
>>> +     /*
>>> +      * Either we have a parent directory and path with slash(es)
>>> +      * or the directory is an immediate child of the root directory.
>>> +      */
>>> +     assert((parent != NULL) ^ (strchr(prefix->buf, '/') == 0));
>>
>
> Also this seems part of the actual shipped code, not testing code.
> In that case we prefer
>
>     if (<condition>)
>         die("BUG: <description>");
>
> This is because asserts may be omitted by the compiler,
> when compiled with NDEBUG.

I mainly wrote that for myself while testing. Now that I'm past that, I'm comfortable removing it completely or converting it to an actual if-die.

Jeff
Previous: Stefan BellerNext: Junio C Hamano
Message 10 of 20 in “thread lazy_init_name_hash”
  1. 0/7 thread lazy_init_name_hashgit@jeffhostetler.com, Mar 23, 2017
  2. 2/7 hashmap: allow memihash computation to be continuedgit@jeffhostetler.com, Mar 23, 2017
  3. 6/7 name-hash: add test-lazy-init-name-hashgit@jeffhostetler.com, Mar 23, 2017
  4. Ramsay JonesMar 23, 2017
  5. 1/7 name-hash: specify initial size for istate.dir_hash tablegit@jeffhostetler.com, Mar 23, 2017
  6. 7/7 name-hash: add perf test for lazy_init_name_hashgit@jeffhostetler.com, Mar 23, 2017
  7. 5/7 name-hash: perf improvement for lazy_init_name_hashgit@jeffhostetler.com, Mar 23, 2017
  8. Ramsay JonesMar 23, 2017
  9. Stefan BellerMar 23, 2017
  10. Jeff HostetlerMar 24, 2017
  11. Junio C HamanoMar 27, 2017
  12. Jeff HostetlerMar 27, 2017
  13. 3/7 hashmap: Add disallow_rehash settinggit@jeffhostetler.com, Mar 23, 2017
  14. 4/7 hashmap: document memihash_cont, hashmap_disallow_rehash apigit@jeffhostetler.com, Mar 23, 2017
  15. Junio C HamanoMar 23, 2017
  16. Jeff HostetlerMar 24, 2017
  17. Stefan BellerMar 24, 2017
  18. Junio C HamanoMar 24, 2017
  19. Duy NguyenApr 6, 2017
  20. Jeff HostetlerApr 6, 2017

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.