Remove inaccurate "zero-{copy,allocation}" claims
This commit is contained in:
@@ -789,7 +789,7 @@ int main() {
|
||||
std::cout << "\nBenchmark completed. The WeaselDB parser is optimized for:\n";
|
||||
std::cout << "- Arena-based memory allocation for reduced fragmentation\n";
|
||||
std::cout << "- Streaming parsing for network protocols\n";
|
||||
std::cout << "- Zero-copy string handling with string views\n";
|
||||
std::cout << "- String views to minimize unnecessary copying\n";
|
||||
std::cout << "- Base64 decoding integrated into parsing pipeline\n";
|
||||
std::cout << "- Efficient reset and reuse for high-throughput scenarios\n";
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ WeaselDB is a high-performance write-side database component designed for system
|
||||
- **High-performance JSON parsing** with streaming support and SIMD optimization
|
||||
- **Multi-threaded networking** using multiple epoll instances with unified I/O thread pool
|
||||
- **Configurable epoll instances** to eliminate kernel-level contention
|
||||
- **Zero-copy design** throughout the pipeline
|
||||
- **Optimized memory management** with arena allocation and efficient copying
|
||||
- **Factory pattern safety** ensuring correct object lifecycle management
|
||||
|
||||
---
|
||||
@@ -152,7 +152,7 @@ A high-performance, multi-stage, lock-free pipeline for inter-thread communicati
|
||||
- **Arena-backed string storage** with efficient memory management
|
||||
- **Move-only semantics** for optimal performance
|
||||
- **Builder pattern** for constructing commit requests
|
||||
- **Zero-copy string views** pointing to arena-allocated memory
|
||||
- **String views** pointing to arena-allocated memory to avoid unnecessary copying
|
||||
|
||||
#### **Configuration & Optimization**
|
||||
|
||||
@@ -242,7 +242,7 @@ The system implements a RESTful API. See [api.md](api.md) for comprehensive API
|
||||
1. **Performance-first** - Every component optimized for high throughput
|
||||
2. **Scalable concurrency** - Multiple epoll instances eliminate kernel contention
|
||||
3. **Memory efficiency** - Arena allocation eliminates fragmentation
|
||||
4. **Zero-copy** - Minimize data copying throughout pipeline
|
||||
4. **Efficient copying** - Minimize unnecessary copies while accepting required ones
|
||||
5. **Streaming-ready** - Support incremental processing
|
||||
6. **Type safety** - Compile-time validation where possible
|
||||
7. **Resource management** - RAII and move semantics throughout
|
||||
@@ -437,7 +437,7 @@ public:
|
||||
|
||||
#### Arena-Based String Handling
|
||||
```cpp
|
||||
// Preferred: Zero-copy string view with arena allocation
|
||||
// Preferred: String view with arena allocation to minimize copying
|
||||
std::string_view process_json_key(const char* data, ArenaAllocator& arena);
|
||||
|
||||
// Avoid: Unnecessary string copies
|
||||
|
||||
@@ -70,7 +70,7 @@ struct Connection {
|
||||
* asynchronously by the server's I/O threads using efficient vectored
|
||||
* I/O.
|
||||
*
|
||||
* @param s The data to send (string view for zero-copy efficiency)
|
||||
* @param s The data to send (string view parameter for efficiency)
|
||||
* @param copy_to_arena If true (default), copies data to the connection's
|
||||
* arena for safe storage. If false, the caller must ensure the data remains
|
||||
* valid until all queued messages are sent.
|
||||
|
||||
6
style.md
6
style.md
@@ -99,7 +99,7 @@ auto addr = reinterpret_cast<uintptr_t>(ptr); // Pointer to integer conv
|
||||
- **Complexity must be justified with benchmarks** - measure performance impact before adding complexity
|
||||
- **Strive for 0% CPU usage when idle** - avoid polling, busy waiting, or unnecessary background activity
|
||||
- Use **inline functions** for performance-critical code (e.g., `allocate_raw`)
|
||||
- **Zero-copy operations** with `std::string_view` over string copying
|
||||
- **String views** with `std::string_view` to minimize unnecessary copying
|
||||
- **Arena allocation** for efficient memory management (~1ns vs ~20-270ns for malloc)
|
||||
|
||||
### Complexity Control
|
||||
@@ -249,7 +249,7 @@ private:
|
||||
- **Parameter passing:**
|
||||
- Pass by value for types ≤ 16 bytes (int, pointers, string_view, small structs)
|
||||
- Pass by const reference for types > 16 bytes (containers, large objects)
|
||||
- **Return by value** for small types (≤ 16 bytes), **string_view** for zero-copy over strings
|
||||
- **Return by value** for small types (≤ 16 bytes), **string_view** to avoid copying strings
|
||||
- **noexcept specification** for move operations and non-throwing functions
|
||||
```cpp
|
||||
std::span<const Operation> operations() const { return operations_; }
|
||||
@@ -307,7 +307,7 @@ for (auto &precondition : preconditions_) {
|
||||
|
||||
### Ownership & Allocation
|
||||
- **Arena allocators** for request-scoped memory with **STL allocator adapters** (see Performance Focus section for characteristics)
|
||||
- **String views** pointing to arena-allocated memory for zero-copy operations
|
||||
- **String views** pointing to arena-allocated memory to avoid unnecessary copying
|
||||
- **STL containers with arena allocators require default construction after arena reset** - `clear()` is not sufficient
|
||||
```cpp
|
||||
// STL containers with arena allocators - correct reset pattern
|
||||
|
||||
2
todo.md
2
todo.md
@@ -42,7 +42,7 @@
|
||||
- [ ] Support for HTTP redirects (3xx responses) with redirect limits
|
||||
- [ ] SSL/TLS support using OpenSSL for HTTPS connections
|
||||
- [ ] Request/response logging and metrics integration
|
||||
- [ ] Memory-efficient design with zero-copy where possible
|
||||
- [ ] Memory-efficient design minimizing unnecessary copying
|
||||
- [ ] Implement fake in-process S3 service using separate Server instance with S3 ConnectionHandler
|
||||
- [ ] Use create_local_connection to get fd for in-process communication
|
||||
- [ ] Implement `ListObjectsV2` API for object enumeration
|
||||
|
||||
Reference in New Issue
Block a user