Update benchmark
This commit is contained in:
4
Makefile
4
Makefile
@@ -1,6 +1,8 @@
|
|||||||
|
CXX=g++
|
||||||
|
CXXFLAGS=-Wall -Wextra -O3
|
||||||
|
|
||||||
benchmark: benchmark.cpp
|
benchmark: benchmark.cpp
|
||||||
g++ -Wall -Wextra -o benchmark benchmark.cpp
|
$(CXX) $(CXXFLAGS) -o benchmark benchmark.cpp
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf benchmark
|
rm -rf benchmark
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
// Initially generated by AI (Google Gemini)
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -10,7 +12,7 @@
|
|||||||
|
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
|
|
||||||
typedef std::chrono::time_point<std::chrono::high_resolution_clock> time_p;
|
typedef time_point<high_resolution_clock> time_p;
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
const int NUM_ELEMENTS = 1000000;
|
const int NUM_ELEMENTS = 1000000;
|
||||||
@@ -50,7 +52,7 @@ void print_row(const std::string& label, double hm_ms, double std_ms)
|
|||||||
uint64_t hash_str(const void *buffer, size_t size)
|
uint64_t hash_str(const void *buffer, size_t size)
|
||||||
{
|
{
|
||||||
(void)size;
|
(void)size;
|
||||||
const char *str = reinterpret_cast<const char *>(buffer);
|
const char *str = reinterpret_cast<const char*>(buffer);
|
||||||
uint64_t hash = (uint64_t)str;
|
uint64_t hash = (uint64_t)str;
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user