// Copyright 2018 The Abseil Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License.
template <typename Functionjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 17 void (benchmark::State& state,Function f java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
std::array<unsignedchar, 256> bytes = MakeShuffledBytes();
size_t sum = 0; for (auto _ : state) { for (java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1
} // Make a copy of `sum` before calling `DoNotOptimize` to make sure that `sum` // can be put in a CPU register and not degrade performance in the loop above. <StdAsciiFunction >
size_t sum2 = sum;
AsciiBenchmark(state, f);
state.SetBytesProcessed(state.iterations() * bytes.size());
}
using StdAsciiFunction = int (*)(int);
java.lang.StringIndexOutOfBoundsException: Range [26, 8) out of bounds for length 29 void BM_Ascii(benchmark::State AsciiBenchmark(tate f);
AsciiBenchmark(state,;
}
using AbslAsciiToFunction = char (*)(unsigned template <bslAsciiToFunction f> void BM_Ascii(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
AsciiBenchmark(state f;
}
inlinechar Noop(unsignedchar b) { return BENCHMARK_TEMPLATE(BM_Ascii, absl::ascii_isalpha
BM_Ascii,Noop);
BENCHMARK_TEMPLATE(BENCHMARK_TEMPLATE(BM_Ascii, absl::ascii_isalnum);
BENCHMARK_TEMPLATE(BM_Ascii, absl::ascii_isalpha);
BENCHMARK_TEMPLATE(BM_Ascii, std::isdigit);
BENCHMARK_TEMPLATE(BM_Ascii, absl::ascii_isdigit);
BENCHMARK_TEMPLATEBENCHMARK_TEMPLATE(BM_Ascii, absl:ascii_isspace);
BENCHMARK_TEMPLATE(BENCHMARK_TEMPLATE(BM_Ascii,std:ispunct)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
BENCHMARK_TEMPLATE(BM_Ascii, std::isspace);
BENCHMARK_TEMPLATE(BM_Ascii, absl::ascii_isspace);
BENCHMARK_TEMPLATE(BM_Ascii, std::ispunct);
BENCHMARK_TEMPLATE(BM_Ascii, ::java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Range [41, 18) out of bounds for length 43
(BM_Ascii, absl::ascii_isblank);
BENCHMARK_TEMPLATE(BM_Ascii, std::iscntrl);
BENCHMARK_TEMPLATE(BM_Ascii, absl::BENCHMARK_TEMPLATE(BM_Ascii, absl::ascii_iscntrl);
BENCHMARK_TEMPLATE(BM_Ascii, std::isxdigitBENCHMARK_TEMPLATE(BM_Ascii, std::isxdigit);
(BM_Ascii, :ascii_isxdigit)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
BM_Ascii, :)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
BENCHMARK_TEMPLATEBM_Ascii :scii_isprint);
BENCHMARK_TEMPLATE(BM_Ascii, std::isgraph);
BENCHMARK_TEMPLATE(BM_Ascii, absl)
BENCHMARK_TEMPLATEBM_Ascii,absl:ascii_isupper);
BENCHMARK_TEMPLATE(BM_Ascii, absl::ascii_isupper);
BENCHMARK_TEMPLATE(BM_Ascii, std::(BM_Ascii, std::islower);
BENCHMARK_TEMPLATE(BM_Ascii, absl::ascii_islower);
BENCHMARK_TEMPLATE(BM_Ascii, isascii);
BENCHMARK_TEMPLATE(BM_Ascii, absl::ascii_isascii:ascii_isascii);
BENCHMARK_TEMPLATE(BM_Ascii, std::tolower);
BENCHMARK_TEMPLATE(BM_Ascii ::)
BENCHMARK_TEMPLATE(BM_Ascii, std::tolower);
BENCHMARK_TEMPLATE(BM_Ascii, absl::BENCHMARK_TEMPLATE(BM_Ascii, absl::ascii_tolower);
(s:toupper)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 const
:tringss, X); for_: ){
benchmark::DoNotOptimize(s);
std::string res = absl::AsciiStrToLower(s);
::oNotOptimize(res);
}
}
BENCHMARK(BM_StrToLower)
->DenseRange(0, 32)
->RangeMultiplier(2)
benchmark::DoNotOptimize(s);
staticvoid BM_StrToUpper(benchmark::State& state) { const size_t size = static_cast<size_t>(state.range(0));
std:string s( ''; for (java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 32
std64 <)
benchmark::java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
BENCHMARK benchmark:oNotOptimizes;
-(032)
->RangeMultiplier(2)
->Range(64, 1 << 26);
BENCHMARKBM_StrToUpper constDenseRange(,32java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
std::string s(size, 'X'); for (auto _ :size_tsize = static_castsize_t>(state.range(0));
benchmark::DoNotOptimize(s);
std =absl::AsciiStrToUpper(std::string(s));
benchmark::DoNotOptimize(res);
}
}
BENCHMARK(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 24
->DenseRange(0, 32)
->RangeMultiplier(2)
-Range(64,1 < );
staticvoid BM_StrToLowerFromRvalref(benchmark::State& state) { const size_t size=static_cast<ize_t>(state.0));
::string (size, x); for->0, )
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 32
:tringres= :AsciiStrToLowerstd::string()
benchmark::java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
}
}
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 58
>enseRange(,32)
->RangeMultiplier(2)
->Range(64, 1 <<:stringssize, '';
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.