Skip to content

Commit 917a616

Browse files
queeliusclaude
andcommitted
Release v3.0: Complete rewrite with benchmarks and paper updates
Major Changes: - Migrated to C++23 for std::expected and concepts - Implemented maph v3 with composable design (hashers, storage, table) - Archived v1/v2 implementations to archive/ directory - Fixed critical hash truncation bug (32-bit storage vs 64-bit comparison) New Features: - Comprehensive benchmark suite (latency, throughput, comparison) - Memory-mapped storage with lock-free reads - Hybrid hasher (perfect hash + FNV-1a with linear probing) - Fixed 512-byte slots with cache-line alignment Benchmarks (1M keys, 200-byte values): - Median GET latency: 351ns (sub-microsecond) - Throughput: 2.69M ops/sec single-threaded, 17.24M with 8 threads - Near-linear scaling: 4.42× speedup on 4 cores (110% efficiency) - 1.88× faster bulk inserts vs std::unordered_map Paper Updates: - Updated Tables I-V with real measured data - Removed fictional benchmarks (SIMD, YCSB, case studies) - Added honest comparison showing trade-offs vs std::unordered_map - Fixed architecture description (removed incorrect 80/20 claim) - Added complete experimental methodology section Documentation: - BENCHMARK_RESULTS.md with comprehensive analysis - PAPER_CHANGES_SUMMARY.md tracking all revisions - REFACTORING_SUMMARY.md documenting code cleanup Build System: - Updated CMakeLists.txt for C++23 and v3 only - Added benchmark and test targets - OpenMP support for future optimizations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent c5e448e commit 917a616

46 files changed

Lines changed: 8892 additions & 137 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cmake_minimum_required(VERSION 3.14)
22
project(maph VERSION 2.0.0 LANGUAGES CXX)
33

4-
# C++17 required
5-
set(CMAKE_CXX_STANDARD 17)
4+
# C++23 required for v3 (concepts, std::expected)
5+
set(CMAKE_CXX_STANDARD 23)
66
set(CMAKE_CXX_STANDARD_REQUIRED ON)
77
set(CMAKE_CXX_EXTENSIONS OFF)
88

@@ -22,45 +22,49 @@ else()
2222
message(STATUS "OpenMP not found - parallel optimizations will be disabled")
2323
endif()
2424

25-
# Header-only library
25+
# Header-only library (v3)
2626
add_library(maph INTERFACE)
27-
target_include_directories(maph INTERFACE
27+
target_include_directories(maph INTERFACE
2828
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
2929
$<INSTALL_INTERFACE:include>
3030
)
31+
target_compile_features(maph INTERFACE cxx_std_23) # v3 requires C++23 for std::expected
3132

32-
# CLI executable
33-
add_executable(maph_cli src/maph_cli.cpp)
34-
target_link_libraries(maph_cli PRIVATE maph)
35-
target_include_directories(maph_cli PRIVATE include)
36-
set_target_properties(maph_cli PROPERTIES OUTPUT_NAME maph)
33+
# CLI executable (TODO: update to v3)
34+
# add_executable(maph_cli src/maph_cli.cpp)
35+
# target_link_libraries(maph_cli PRIVATE maph)
36+
# target_include_directories(maph_cli PRIVATE include)
37+
# set_target_properties(maph_cli PROPERTIES OUTPUT_NAME maph)
3738

3839
# Installation
39-
install(TARGETS maph_cli DESTINATION bin)
40-
install(FILES include/maph.hpp DESTINATION include)
40+
# install(TARGETS maph_cli DESTINATION bin)
41+
install(DIRECTORY include/maph/v3 DESTINATION include/maph)
4142

42-
# Tests
43+
# Tests (v3)
4344
option(BUILD_TESTS "Build tests" OFF)
4445
if(BUILD_TESTS)
4546
enable_testing()
4647
add_subdirectory(tests)
47-
48-
# Benchmark executable
49-
add_executable(bench_maph tests/bench_maph.cpp)
50-
target_link_libraries(bench_maph PRIVATE maph pthread)
51-
target_include_directories(bench_maph PRIVATE include)
48+
endif()
49+
50+
# Benchmarks (v3)
51+
option(BUILD_BENCHMARKS "Build benchmarks" OFF)
52+
if(BUILD_BENCHMARKS)
53+
add_subdirectory(benchmarks)
54+
endif()
5255

53-
# Link OpenMP if found
54-
if(OpenMP_CXX_FOUND)
55-
target_link_libraries(bench_maph PRIVATE OpenMP::OpenMP_CXX)
56-
endif()
56+
# Examples (v3)
57+
option(BUILD_EXAMPLES "Build examples" OFF)
58+
if(BUILD_EXAMPLES)
59+
# V3 demo
60+
add_executable(v3_demo examples/v3_demo.cpp)
61+
target_link_libraries(v3_demo PRIVATE maph)
62+
target_include_directories(v3_demo PRIVATE include)
5763

58-
# Enable AVX2 if available
59-
include(CheckCXXCompilerFlag)
60-
CHECK_CXX_COMPILER_FLAG("-mavx2" COMPILER_SUPPORTS_AVX2)
61-
if(COMPILER_SUPPORTS_AVX2)
62-
target_compile_options(bench_maph PRIVATE -mavx2)
63-
endif()
64+
# V3 simple test
65+
add_executable(v3_simple_test examples/v3_simple_test.cpp)
66+
target_link_libraries(v3_simple_test PRIVATE maph)
67+
target_include_directories(v3_simple_test PRIVATE include)
6468
endif()
6569

6670
# Integrations

archive/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Archived Files
2+
3+
This directory contains obsolete implementations from v1 and v2 of maph.
4+
5+
## What's Here
6+
7+
- **include/**: Old header files (v1, v2, and intermediate versions)
8+
- **src/**: Old source files (v2 CLI, old perfect hash impl)
9+
- **tests/**: Old test files for previous versions
10+
- **integrations/**: Old integration code (v2 REST API)
11+
12+
## Current Implementation
13+
14+
The current implementation is **v3**, located at:
15+
- `include/maph/v3/` - All v3 headers
16+
- `tests/v3/` - All v3 tests
17+
- `examples/v3_*.cpp` - V3 examples
18+
19+
## Why Archived
20+
21+
These files were replaced by the cleaner, more composable v3 architecture which:
22+
- Uses modern C++17 features (concepts, std::expected)
23+
- Has better separation of concerns
24+
- Provides composable components (storage, hashers, tables)
25+
- Supports both perfect and standard hashing elegantly
26+
27+
## Restoration
28+
29+
If you need any of these files, they're preserved here and in git history.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)