27 using namespace impala;
45 #define VALIDATE_RESULT(actual, expected, str) \
46 if (actual != expected) { \
47 cout << "Parse Error. " \
48 << "String: " << str \
49 << ". Parsed: " << actual << endl; \
53 #define VALIDATE_RESULT(actual, expected, str)
57 vector<StringValue> data;
58 vector<string> memory;
63 data->
memory.push_back(input);
64 const string& str = data->
memory.back();
65 data->
data.push_back(
StringValue(const_cast<char*>(str.c_str()), str.length()));
69 for (
int i = 0; i < n; ++i) {
72 val = (val * (max - min)) + min;
81 for (
int i = 0; i < batch_size; ++i) {
82 int n = data->
data.size();
83 for (
int j = 0; j < n; ++j) {
91 for (
int i = 0; i < batch_size; ++i) {
92 int n = data->
data.size();
93 for (
int j = 0; j < n; ++j) {
96 double val = StringParser::StringToFloat<double>(str.
ptr, str.
len, &dummy);
105 for (
int i = 0; i < batch_size; ++i) {
106 int n = data->
data.size();
107 for (
int j = 0; j < n; ++j) {
108 data->
result[j] = strtod(data->
data[j].ptr, NULL);
113 int main(
int argc,
char **argv) {
int AddBenchmark(const std::string &name, BenchmarkFunction fn, void *args, int baseline_idx=0)
void TestAtof(int batch_size, void *d)
void TestStrtod(int batch_size, void *d)
static std::string GetMachineInfo()
Output machine/build configuration as a string.
std::string Measure()
Runs all the benchmarks and returns the result in a formatted string.
void AddTestData(TestData *data, const string &input)
void TestImpala(int batch_size, void *d)
vector< StringValue > data
static void Init()
Initialize CpuInfo.
#define VALIDATE_RESULT(actual, expected, str)
int main(int argc, char **argv)