zhylcq / EngineRaceRapids

Rapids团队 (https://github.com/CheYulin , https://github.com/shixuansun and https://github.com/WANG-lp), Engine Race (Key-Value Store on Intel Optane SSD),线上成绩413.69s, 排名第1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Disclaimer

此项目仅供学习与交流使用,请遵循MIT协议,如果您在任何项目中使用相关代码,请保留此项目的LICENSE文件。

文档

说明 文件
Code-Review documents/code-review.md
比赛攻略 documents/contest_summary_toc.md
PDF-比赛攻略 release-pdf-documents/Rapids-Contest-Summary.pdf
PDF-答辩PPT release-pdf-documents/Rapids-Defense-PPT.pdf

目录结构

项目代码在两个目录中 engine_raceplayground。 浏览代码可以用clion打开项目看。

KV-DB引擎实现的代码

文件 说明
engine_race/barrier.h 可以重复使用的barrier,通过generation来支持
engine_race/blocking_queue.h 简单的blocking-queue实现 (没有任何性能考虑的)
engine_race/concurrentqueue.h, engine_race/blockingconcurrentqueue.h 工业级别的blocking-queue实现 cameron314/concurrentqueue,具体使用参考两个文件中的license
engine_race/file_util.h 文件相关的封装
engine_race/util.h 统计性能调优的信息: dstat, iostat, 内存占用; 打印timestamp和对应代码行位置util
engine_race/log.h, engine_race/log.cc log工具, 稍做修改
engine_race/engine_race.h, engine_race/engine_race.cc KV-DB具体实现
  • 曾经使用的文件
文件 说明
engine_race/thread_pool.h 简单的线程池实现 progschj/ThreadPool, 在之前版本中使用, 后来改用std::thread, std::promise, std::future代替了
engine_race/sparsepp 高效的sparese hashmap实现,特点: 空间占用少, greg7mdp/sparsepp
  • 官方头文件

请见include, 主要有enginepolar_string的定义。

测试的代码

文件 说明
playground/test_engine.cpp 测试代码, 三阶段分别使用不同的omp线程池

官方的样例代码

目录 说明
engine_example 官方样例主要代码
test 官方样例测试代码

Cmake Config文件

文件 说明
CMakeLists.txt 根cmakelist
playground/CMakeLists.txt playground cmakelist

本地测试使用

mkdir build && cd build 
cmake ..
make -j
./playground/test_engine_nonoff        

官方的Makefile build

请见Makefileengine_race/Makefile, 生成的静态链接库在./lib目录下。

make -C . TARGET_ENGINE=engine_race

最终线上效果

  • 历史最佳成绩: 413.69 seconds

  • 进程elapsed time

写入进程的历史最佳状态: 114.1 seconds左右
读取进程的历史最佳状态: 105.9 seconds左右 (包括0.2 seconds index构建)
Range进程的历史最佳状态: 192.1 seconds左右 (包括0.2 seconds index构建)
  • 进程启动间隔
写入启动的间隔: 0.1 seconds 左右
写入到读取的间隔: 0.35 seconds左右
读取到Range的间隔: 0.45 seconds左右

About

Rapids团队 (https://github.com/CheYulin , https://github.com/shixuansun and https://github.com/WANG-lp), Engine Race (Key-Value Store on Intel Optane SSD),线上成绩413.69s, 排名第1

License:MIT License


Languages

Language:C++ 93.9%Language:C 4.3%Language:Makefile 1.6%Language:CMake 0.2%