[libcxx-commits] [libcxx] [libc++] Optimize `text_encoding::environment_is()` for UTF-8, ASCII, Windows1252 and ISOLatin1 (PR #225136)

William Tran-Viet via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 23 06:40:57 PDT 2026


smallp-o-p wrote:

> > > I'd really like to see some numbers on this. I can't reproduce that the user has to store any table at all with the current implementation: https://godbolt.org/z/7hjTMr9fP
> 
> > > I'm also not sure why we care too much about the performance here? Is this function expected to be hot in any way?
> 
> > 
> 
> > The best I could do is show the aliases in `strings`: https://godbolt.org/z/GsvnKMj94, I'm not entirely sure why other tools can't find it.
> 
> 
> 
> Because it's in the debug info: https://godbolt.org/z/4Tf366hPP
> 
> 
> 
> > "Optimization" in this case is with respect to disk space and memory.
> 
> 
> 
> Yeah, I'm not convinced this is worth the minuscule improvements we seem to get here.

The compiler is far smarter than I gave it credit for, so I'll close this patch since it appears the original concern was moot from the beginning.

https://github.com/llvm/llvm-project/pull/225136


More information about the libcxx-commits mailing list