summaryrefslogtreecommitdiff
path: root/src/parsing.h
diff options
context:
space:
mode:
authorPetr Makhnev <51853996+i582@users.noreply.github.com>2024-10-11 03:15:28 +0400
committerGitHub <noreply@github.com>2024-10-10 16:15:28 -0700
commit34906bfbc99d31b3e62d2d006af2247d8418ba2f (patch)
treedd0408aef3abbbdcc13064cec8c5e6d4780013d4 /src/parsing.h
parentf0a5e488ae68074837706edafb54050e56cf9937 (diff)
downloadbinaryen-34906bfbc99d31b3e62d2d006af2247d8418ba2f.tar.gz
binaryen-34906bfbc99d31b3e62d2d006af2247d8418ba2f.tar.bz2
binaryen-34906bfbc99d31b3e62d2d006af2247d8418ba2f.zip
Optimize Module::get_* family of functions with std::string_view in getModuleElement (#6998)
Passing a constant string to functions requires memory allocation, and allocation is inherently slow. Since we are using C++17, we can use string_view and remove this unnecessary allocation. Although the code seems simple enough for the optimizer to remove this allocation after inlining, tests on Clang 18 show that this is not the case (on Apple Silicon at least).
Diffstat (limited to 'src/parsing.h')
0 files changed, 0 insertions, 0 deletions