Skip to content

Commit

Permalink
bench: drop leftover boost::lexical_cast benches, drop header from …
Browse files Browse the repository at this point in the history
…list

`boost::lexical_cast` isn't used anywhere in Dash Core, the sole remaining
use being in a benchmark, despite it no longer being used in Dash Core.
Let's drop the benchmark and drop `boost/lexical_cast.hpp` from allowed
Boost headers
  • Loading branch information
kwvg committed Apr 23, 2024
1 parent 0bb188a commit c47e9e7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
32 changes: 0 additions & 32 deletions src/bench/string_cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <util/strencodings.h>
#include <util/string.h>

#include <boost/lexical_cast.hpp>
#include <string>

template <typename T>
Expand All @@ -25,21 +24,6 @@ static void int_atoi(benchmark::Bench& bench)
});
}

static void int_lexical_cast(benchmark::Bench& bench)
{
bench.run([&] {
boost::lexical_cast<int>("1");
});
}

static void strings_1_lexical_cast(benchmark::Bench& bench)
{
int i{0};
bench.run([&] {
boost::lexical_cast<std::string>(++i);
});
}

static void strings_1_numberToString(benchmark::Bench& bench)
{
int i{0};
Expand All @@ -56,19 +40,6 @@ static void strings_1_tostring(benchmark::Bench& bench)
});
}

static void strings_2_multi_lexical_cast(benchmark::Bench& bench)
{
int i{0};
bench.run([&] { static_cast<void>(
boost::lexical_cast<std::string>(i) +
boost::lexical_cast<std::string>(i+1) +
boost::lexical_cast<std::string>(i+2) +
boost::lexical_cast<std::string>(i+3) +
boost::lexical_cast<std::string>(i+4));
++i;
});
}

static void strings_2_multi_numberToString(benchmark::Bench& bench)
{
int i{0};
Expand Down Expand Up @@ -97,11 +68,8 @@ static void strings_2_strptintf(benchmark::Bench& bench)
}

BENCHMARK(int_atoi);
BENCHMARK(int_lexical_cast);
BENCHMARK(strings_1_lexical_cast);
BENCHMARK(strings_1_numberToString);
BENCHMARK(strings_1_tostring);
BENCHMARK(strings_2_multi_lexical_cast);
BENCHMARK(strings_2_multi_numberToString);
BENCHMARK(strings_2_multi_tostring);
BENCHMARK(strings_2_strptintf);
1 change: 0 additions & 1 deletion test/lint/lint-includes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ EXPECTED_BOOST_INCLUDES=(
boost/filesystem.hpp
boost/filesystem/fstream.hpp
boost/function.hpp
boost/lexical_cast.hpp
boost/multi_index/hashed_index.hpp
boost/multi_index/ordered_index.hpp
boost/multi_index/sequenced_index.hpp
Expand Down

0 comments on commit c47e9e7

Please sign in to comment.