4 #include <glog/logging.h>
6 #include "tuple-types.h"
12 #define STREAMING true
14 using namespace impala;
57 inline void BufferTuple(
const ProbeTuple* tuple,
Buffer* buffer) {
60 buffer_buffer->tuples[buffer_buffer->count++] = *tuple;
62 DCHECK_LE(buffer->count + buffer_buffer->count,
BUFFER_TUPLES);
64 __m128i* buffer_write_ptr = (__m128i*)&buffer->tuples[buffer->count];
66 DCHECK_EQ(buffer_buffer->count % 2, 0);
67 for (
int i = 0; i < buffer_buffer->count; i += 2) {
68 __m128i content = _mm_set_epi64x(*(
long long*) (buffer_buffer->tuples + i),
69 *(
long long*) (buffer_buffer->tuples + i + 1));
70 _mm_stream_si128(buffer_write_ptr + i/2, content);
72 buffer->count += buffer_buffer->count;
73 buffer_buffer->count = 0;
86 new (buffers_ + i)
Buffer();
93 const ProbeTuple* tuple = &tuples[i];
94 Buffer* buffer = &buffers_[tuple->id];
96 BufferTuple(tuple, buffer);
98 buffer->tuples[buffer->count++] = *tuple;
111 const int NUM_RECORDS = 1<<27;
112 int64_t* buffer = (int64_t*) malloc(
sizeof(
long) * NUM_RECORDS);
113 int64_t constant = 0xFA57;
116 for (int64_t i = 0; i < NUM_RECORDS; ++i) {
117 buffer[i] = constant;
131 int main(
int argc,
char** argv) {
132 google::InitGoogleLogging(argv[0]);
static const uint64_t DATA_TUPLES
static const uint64_t NUM_BUFFERS
static const uint64_t BUFFER_BYTES
ProbeTuple tuples[BUFFER_TUPLES]
static const uint64_t FANOUT_BITS
BufferBuffer * buffer_buffers_
struct impala::PartitioningThroughputTest::Buffer __attribute__((__packed__)) __attribute__((aligned(64)))
static const uint64_t DATA_BYTES
static std::string Print(bool value, TUnit::type ignored, bool verbose=false)
ProbeTuple tuples[BUFFER_TUPLES]
uint8_t offset[7 *64-sizeof(uint64_t)]
uint8_t padding[64-sizeof(int)]
static void Init()
Initialize CpuInfo.
static const int STREAMING_BUFFER_TUPLES
int main(int argc, char **argv)
static const uint64_t BUFFER_TUPLES