Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc++] Implement generic associative container benchmarks #123663

Merged
merged 16 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libcxx/test/benchmarks/GenerateInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,18 @@ struct Generate<T> {
static T arbitrary() { return 42; }
static T cheap() { return 42; }
static T expensive() { return 42; }
static T random() { return getRandomInteger<T>(std::numeric_limits<T>::min(), std::numeric_limits<T>::max()); }
};

template <>
struct Generate<std::string> {
static std::string arbitrary() { return "hello world"; }
static std::string cheap() { return "small"; }
static std::string expensive() { return std::string(256, 'x'); }
static std::string random() {
auto length = getRandomInteger<std::size_t>(1, 1024);
return getRandomString(length);
}
};

#endif // BENCHMARK_GENERATE_INPUT_H
Loading
Loading