Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
atoi-benchmark.cc File Reference
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <sstream>
#include "runtime/string-value.h"
#include "util/benchmark.h"
#include "util/cpu-info.h"
#include "util/string-parser.h"
#include "common/names.h"
Include dependency graph for atoi-benchmark.cc:

Go to the source code of this file.

Classes

struct  TestData< Decimal >
 

Macros

#define VALIDATE   0
 
#define VALIDATE_RESULT(actual, expected, str)
 
#define DIGIT(c)   (c -'0')
 

Functions

void AddTestData (TestData *data, const string &input)
 
void AddTestData (TestData *data, int n, int32_t min=-10, int32_t max=10, bool leading_space=false, bool trailing_space=false)
 
int32_t AtoiUnsafe (char *s, int len)
 
int32_t AtoiUnrolled (char *s, int len)
 
int32_t AtoiCased (char *s, int len)
 
void TestAtoi (int batch_size, void *d)
 
void TestStrtol (int batch_size, void *d)
 
void TestImpala (int batch_size, void *d)
 
void TestImpalaUnsafe (int batch_size, void *d)
 
void TestImpalaUnrolled (int batch_size, void *d)
 
void TestImpalaCased (int batch_size, void *d)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

#define DIGIT (   c)    (c -'0')

Definition at line 84 of file atoi-benchmark.cc.

Referenced by AtoiCased(), AtoiUnrolled(), and AtoiUnsafe().

#define VALIDATE   0

Definition at line 43 of file atoi-benchmark.cc.

#define VALIDATE_RESULT (   actual,
  expected,
  str 
)

Function Documentation

void AddTestData ( TestData data,
const string &  input 
)

Definition at line 64 of file atoi-benchmark.cc.

References TestData< Decimal >::data, and TestData< Decimal >::memory.

Referenced by AddTestData(), and main().

void AddTestData ( TestData data,
int  n,
int32_t  min = -10,
int32_t  max = 10,
bool  leading_space = false,
bool  trailing_space = false 
)

Definition at line 70 of file atoi-benchmark.cc.

References AddTestData().

int32_t AtoiCased ( char *  s,
int  len 
)
inline

Definition at line 135 of file atoi-benchmark.cc.

References AtoiUnsafe(), DIGIT, and LIKELY.

Referenced by TestImpalaCased().

int32_t AtoiUnrolled ( char *  s,
int  len 
)
inline

Definition at line 102 of file atoi-benchmark.cc.

References AtoiUnsafe(), DIGIT, and LIKELY.

Referenced by TestImpalaUnrolled().

int32_t AtoiUnsafe ( char *  s,
int  len 
)
inline

Definition at line 86 of file atoi-benchmark.cc.

References DIGIT.

Referenced by AtoiCased(), AtoiUnrolled(), and TestImpalaUnsafe().

void TestAtoi ( int  batch_size,
void *  d 
)

Definition at line 168 of file atoi-benchmark.cc.

References TestData< Decimal >::data, and TestData< Decimal >::result.

Referenced by main().

void TestImpala ( int  batch_size,
void *  d 
)
void TestImpalaCased ( int  batch_size,
void *  d 
)
void TestImpalaUnrolled ( int  batch_size,
void *  d 
)
void TestImpalaUnsafe ( int  batch_size,
void *  d 
)
void TestStrtol ( int  batch_size,
void *  d 
)

Definition at line 178 of file atoi-benchmark.cc.

References TestData< Decimal >::data, and TestData< Decimal >::result.

Referenced by main().