mirror of
https://github.com/pocoproject/poco.git
synced 2025-12-10 09:44:35 +01:00
* chore(CppParser): 0, NULL --> nullptr * chore(Crypto): 0, NULL --> nullptr * chore(DNSSD): 0, NULL --> nullptr * chore(Encodings): 0, NULL --> nullptr * chore(CppUnit): Correct indentation. * chore(Foundation): 0, NULL --> nullptr * chore(CMake): Always warn about wrong nullptr usage when compiling with GCC or CLang * chore(Net): 0, NULL --> nullptr * chore(Foundation): 0, NULL --> nullptr * chore(Data): 0, NULL --> nullptr * chore(macOS): 0, NULL --> nullptr * chore(XML): 0, NULL --> nullptr * chore(Zip): 0, NULL --> nullptr * chore(Util): 0, NULL --> nullptr * chore(Net/NetSSL): 0, NULL --> nullptr * chore(Bonjour): 0, NULL --> nullptr * chore(MongoDB, Redis): 0, NULL --> nullptr * chore(Poco): 0, NULL --> nullptr * chore(Win32): 0, NULL --> nullptr * chore(CMake): Only warn about nullptr when verbose warnings are enabled. * Potential fix for code scanning alert no. 1634: Guarded Free Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * chore(Net): Fix warning reported by gitlab. * chore(gitlab CI): attempt to clean to gain disk space on the runner. * chore(gitlab CI): Run build with --parallel 4, correct docker cleanup. --------- Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
@@ -24,14 +24,14 @@ static void BM_CharacterCount(benchmark::State& st) {
|
||||
st.counters["num_tokens"] = getNumTokens(query);
|
||||
st.counters["num_chars"] = query.size();
|
||||
while (st.KeepRunning()) {
|
||||
hsql::SQLParserResult result;
|
||||
hsql::SQLParser::parse(query, &result);
|
||||
hsql::SQLParserResult result;
|
||||
hsql::SQLParser::parse(query, &result);
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_CharacterCount)
|
||||
->RangeMultiplier(1 << 2)
|
||||
->Ranges({{1 << 5, 1 << 15},
|
||||
{5, 5}});
|
||||
{5, 5}});
|
||||
|
||||
// Benchmark the influence of increasing number of tokens, while
|
||||
// the number of characters remains unchanged.
|
||||
@@ -46,42 +46,42 @@ static void BM_ConditionalTokens(benchmark::State& st) {
|
||||
std::stringstream condStream;
|
||||
size_t missingTokens = numTokens - 4;
|
||||
if (missingTokens > 0) {
|
||||
condStream << " WHERE a";
|
||||
missingTokens -= 2;
|
||||
condStream << " WHERE a";
|
||||
missingTokens -= 2;
|
||||
|
||||
while (missingTokens > 0) {
|
||||
condStream << " AND a";
|
||||
missingTokens -= 2;
|
||||
}
|
||||
while (missingTokens > 0) {
|
||||
condStream << " AND a";
|
||||
missingTokens -= 2;
|
||||
}
|
||||
}
|
||||
|
||||
query += condStream.str();
|
||||
|
||||
if (targetSize >= query.size()) {
|
||||
const size_t pad = targetSize - query.size();
|
||||
const std::string filler = std::string(pad, 'a');
|
||||
query.replace(7, 1, filler);
|
||||
const size_t pad = targetSize - query.size();
|
||||
const std::string filler = std::string(pad, 'a');
|
||||
query.replace(7, 1, filler);
|
||||
|
||||
} else {
|
||||
// Query can't be the same length as in the other benchmarks.
|
||||
// Running this will result in unusable data.
|
||||
fprintf(stderr, "Too many tokens. Query too long for benchmark char limit (%lu > %lu).\n",
|
||||
query.size(), targetSize);
|
||||
return;
|
||||
// Query can't be the same length as in the other benchmarks.
|
||||
// Running this will result in unusable data.
|
||||
fprintf(stderr, "Too many tokens. Query too long for benchmark char limit (%lu > %lu).\n",
|
||||
query.size(), targetSize);
|
||||
return;
|
||||
}
|
||||
|
||||
st.counters["num_tokens"] = getNumTokens(query);
|
||||
st.counters["num_chars"] = query.size();
|
||||
while (st.KeepRunning()) {
|
||||
hsql::SQLParserResult result;
|
||||
hsql::SQLParser::parse(query, &result);
|
||||
if (!result.isValid()) st.SkipWithError("Parsing failed!");
|
||||
hsql::SQLParserResult result;
|
||||
hsql::SQLParser::parse(query, &result);
|
||||
if (!result.isValid()) st.SkipWithError("Parsing failed!");
|
||||
}
|
||||
}
|
||||
BENCHMARK(BM_ConditionalTokens)
|
||||
->RangeMultiplier(1 << 2)
|
||||
->Ranges({{1 << 14, 1 << 14},
|
||||
{1 << 2, 1 << 11}});
|
||||
{1 << 2, 1 << 11}});
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user