Consolidate config docs in config.md, update file references

This commit is contained in:
2025-08-18 16:13:08 -04:00
parent 53fce46283
commit 0e49025c0e
2 changed files with 75 additions and 15 deletions

View File

@@ -78,7 +78,7 @@ Parser capabilities:
- Memory-efficient string views backed by arena storage
- Perfect hash table lookup for JSON keys using gperf
#### 4. **Parser Interface** (`src/parser_interface.hpp`)
#### 4. **Parser Interface** (`src/commit_request_parser.hpp`)
- **Abstract base class** for commit request parsers
- **Format-agnostic parsing interface** supporting multiple serialization formats
- **Streaming and one-shot parsing modes**
@@ -88,12 +88,10 @@ Parser capabilities:
- **TOML-based configuration** using `toml11` library
- **Structured configuration** with server, commit, and subscription sections
- **Default fallback values** for all configuration options
- **Type-safe parsing** with validation
- **Type-safe parsing** with validation and bounds checking
- **Comprehensive validation** with meaningful error messages
Configuration domains:
- **Server**: bind address, port, request size limits
- **Commit**: request ID validation, retention policies
- **Subscription**: buffer management, keepalive intervals
See `config.md` for complete configuration documentation.
#### 6. **JSON Token Optimization** (`src/json_tokens.gperf`, `src/json_token_enum.hpp`)
- **Perfect hash table** generated by gperf for O(1) JSON key lookup
@@ -170,7 +168,7 @@ The project includes comprehensive testing infrastructure:
Build targets:
- `test_arena_allocator`: Arena allocator functionality tests
- `test_commit_request`: JSON parsing and validation tests
- `weaseldb`: Main application demonstrating configuration and parsing
- Main server executable (compiled from `src/main.cpp`)
- `bench_arena_allocator`: Arena allocator performance benchmarks
- `bench_commit_request`: JSON parsing performance benchmarks
- `bench_parser_comparison`: Comparison benchmarks vs nlohmann::json and RapidJSON
@@ -214,7 +212,7 @@ The modular design allows each component to be optimized independently while mai
- **Build-Generated**: `build/` contains CMake-generated files including `json_tokens.cpp`
### Adding New Parsers
- Inherit from `ParserInterface` in `src/parser_interface.hpp`
- Inherit from `CommitRequestParser` in `src/commit_request_parser.hpp`
- Implement both streaming and one-shot parsing modes
- Use arena allocation for all temporary string storage
- Add corresponding test cases in `tests/`
@@ -228,8 +226,8 @@ The modular design allows each component to be optimized independently while mai
### Configuration Management
- All configuration is TOML-based using `config.toml`
- Default values are provided in `src/config.cpp`
- Configuration sections: server, commit, subscription
- Comprehensive documentation available in `config.md`
- Type-safe parsing with validation and bounds checking
- Always validate configuration values and provide meaningful errors
### Testing Strategy