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

Re: [PATCH] Replace strcmp_icase with strequal_icase

From
Duy Nguyen <pclouds@gmail.com>
Date
Mar 9, 2013, 10:54 UTC
Message-ID
<CACsJy8BbXjJeTgo0DzKKMY7B3NZB=r3r+Z-WsWJR=t00DkTVzQ@mail.gmail.com>
In-Reply-To
<CACsJy8CphBDKsAAKjCoze98jv=4U+3pN3cW1OYD5XNhYgfcVCA@mail.gmail.com>
On Sat, Mar 9, 2013 at 5:40 PM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 9 quoted lines
> On Sat, Mar 9, 2013 at 3:42 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:
>> To improve performance.
>
> BTW, by rolling our own string comparison, we may lose certain
> optimizations done by C library. In case of glibc, it may choose to
> run an sse4.2 version where 16 bytes are compared at a time. Maybe we
> encounter "string not equal" much often than "string equal" and such
> an optimization is unncessary, I don't know. Measured numbers say it's
> unncessary as my cpu supports sse4.2.

Another problem is locale. Git's toupper() does not care about locale, which should be fine in most cases. strcasecmp is locale-aware, our new str[n]equal_icase is not. It probably does not matter for (ascii-based) pathnames, I guess. core.ignorecase users, any comments?

-- 
Duy
Previous: Duy NguyenNext: Fredrik Gustafsson
Message 5 of 9 in “Replace strcmp_icase with strequal_icase”
  1. Replace strcmp_icase with strequal_icaseFredrik Gustafsson, Mar 9, 2013
  2. Fredrik GustafssonMar 9, 2013
  3. Duy NguyenMar 9, 2013
  4. Duy NguyenMar 9, 2013
  5. Duy NguyenMar 9, 2013
  6. Fredrik GustafssonMar 9, 2013
  7. Duy NguyenMar 9, 2013
  8. Fredrik GustafssonMar 9, 2013
  9. Duy NguyenMar 9, 2013

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.