Skip to content

Commit

Permalink
Address feedback; Fix typos and remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
nirosys committed Oct 12, 2023
1 parent a090c96 commit cdf48c9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 79 deletions.
1 change: 0 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ add_executable(all_tests
test_ion_reader_seek.cpp
)

# add_subdirectory(googletest EXCLUDE_FROM_ALL)
set_property(TARGET all_tests PROPERTY CXX_STANDARD 98)


Expand Down
77 changes: 0 additions & 77 deletions tools/ion-bench/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,83 +58,6 @@ struct data_name {
template<size_t N>
data_name(char const (&)[N]) -> data_name<N - 1>;

/*
* Deserialization benchmark.
*/
// template <typename T, data_name dataset, Format format>
// void deser(benchmark::State &state) {
// T impl;
// DataLoader data((char const *)dataset, T::suffix(), format);
// size_t total_bytes = 0;
// ValueStats stats = {0};
// state.SetLabel(T::suffix()); // Sets the field "label" in the json output to our suffix, so we can match later.
//
// # ifdef TRACK_MEMORY
// clear_memusage();
// start_memusage();
// # endif
//
// int count = 0;
// for (auto _ : state) {
// auto vals = impl.deserialize(data.buffer(), data.length());
// total_bytes += data.length();
// stats += vals;
// count += 1;
// }
// state.counters["Bps"] = benchmark::Counter(total_bytes, benchmark::Counter::kIsRate);
// state.counters["objs"] = benchmark::Counter(stats.num_objs);
// state.counters["bools"] = benchmark::Counter(stats.num_bools);
// state.counters["strs"] = benchmark::Counter(stats.num_strs);
// state.counters["nulls"] = benchmark::Counter(stats.num_nulls);
// state.counters["nums"] = benchmark::Counter(stats.num_nums);
//
// # ifdef TRACK_MEMORY
// struct memory_usage usage = {0};
// load_memusage(&usage);
// stop_memusage();
// clear_memusage();
//
// state.counters["tot_bytes_alloc"] = benchmark::Counter(usage.alloc, benchmark::Counter::kAvgIterations);
// state.counters["tot_bytes_freed"] = benchmark::Counter(usage.freed, benchmark::Counter::kAvgIterations);
// state.counters["hi_usage_bytes"] = benchmark::Counter(usage.high, benchmark::Counter::kAvgIterations);
// state.counters["lo_usage_bytes"] = benchmark::Counter(usage.low, benchmark::Counter::kAvgIterations);
// # endif
// }

/*
* Serialization Benchmark.
*/
// template <typename T, data_name dataset, Format format>
// void ser(benchmark::State &state) {
// T impl;
// DataLoader data((char const *)dataset, T::suffix(), format);
// size_t total_bytes = 0;
// ValueStats stats = {0};
// state.SetLabel(T::suffix()); // Sets the field "label" in the json output to our suffix, so we can match later.
//
// impl.load_data(data.buffer(), data.length());
// size_t buffer_size = impl.data_size() * 2;
//
// // TODO: Let the implementation determine this.
// uint8_t *buffer = new uint8_t[buffer_size];
// size_t output_size = 0;
//
// for (auto _: state) {
// output_size = buffer_size;
// auto iter_stats = impl.serialize_loaded_data(buffer, output_size, format == Format::Pretty);
// stats += iter_stats;
// }
//
// delete[] buffer;
//
// state.counters["Bps"] = benchmark::Counter(stats.serde_bytes, benchmark::Counter::kIsRate, benchmark::Counter::OneK::kIs1024);
//
// # ifdef TRACK_MEMORY
// clear_memusage();
// start_memusage();
// # endif
// }

template <typename T>
void deser_profile(const char *const dataset, Format format, size_t num) {
T impl;
Expand Down
2 changes: 1 addition & 1 deletion tools/ion-bench/src/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#include "memory.h"

// This is not threadsafe.. we should not be executing benchmarks using
// This is not threadsafe. We should not be executing benchmarks using
// multiple threads. This should only be included in a build where we
// want to track memory usage. Which should be handled by our CMake
// config.
Expand Down

0 comments on commit cdf48c9

Please sign in to comment.