llvm / llvm/llvm-project

String match efficiency in libc environment

Open
#196,016 1 comment 0 reactions 0 assignees View on GitHub
libc libc:potential-optimizations
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

The environment matching code in libc currently does a strlen (as part of creating a string_view) of every variable in the environment. This is a waste for long environment variables like PATH which can be hundreds of characters. We could truncate the search at NULL or the right number of characters if we didn't use a string_view (or used a modified container that lazily calculated the string length)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.