-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCargo.toml
More file actions
138 lines (115 loc) · 4.46 KB
/
Cargo.toml
File metadata and controls
138 lines (115 loc) · 4.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
[package]
name = "zeropool"
version = "0.3.1"
edition = "2024"
authors = ["Botir Khaltaev"]
description = "High-performance buffer pool with constant-time allocation, thread-safe operations, and 5x speedup over bytes crate"
repository = "https://github.com/botirk38/zeropool"
license = "MIT OR Apache-2.0"
keywords = ["buffer", "pool", "io", "performance", "zero-copy"]
categories = ["memory-management", "data-structures"]
readme = "README.md"
# =============================================================================
# Lint Configuration
# =============================================================================
# Main Clippy configuration is in clippy.toml
# Formatting configuration is in rustfmt.toml
#
# This section defines lint levels for the crate.
# Strategy: Deny critical issues, warn on quality/style issues
[lints.rust]
# Warn on unsafe code usage (we allow it but want visibility)
unsafe_code = "warn"
# Enforce documentation for public API
missing_docs = "warn"
# Warn on missing debug implementations
missing_debug_implementations = "warn"
# Catch unused items
unused = "warn"
[lints.clippy]
# =============================================================================
# DENY: Critical correctness, safety, and performance issues
# =============================================================================
# These will fail compilation - must be fixed immediately
correctness = { level = "deny", priority = -1 }
suspicious = { level = "deny", priority = -1 }
perf = { level = "deny", priority = -1 }
undocumented_unsafe_blocks = { level = "deny", priority = -1 }
# =============================================================================
# WARN: Code quality, style, and best practices
# =============================================================================
# These will show warnings - should be addressed before release
# Use lower priority (-2) so specific lint settings can override these groups
all = { level = "warn", priority = -2 }
pedantic = { level = "warn", priority = -2 }
complexity = { level = "warn", priority = -2 }
style = { level = "warn", priority = -2 }
cargo = { level = "warn", priority = -2 }
# =============================================================================
# ALLOW: Pragmatic exceptions for performance-critical code
# =============================================================================
# These are intentionally allowed for valid reasons in this codebase
# Performance optimizations
inline_always = "allow" # Used deliberately for hot paths
cast_possible_truncation = "allow" # Intentional in shard indexing
cast_precision_loss = "allow" # Acceptable for metrics/stats
cast_sign_loss = "allow" # Safe in context
# Code organization
module_name_repetitions = "allow" # pool::Pool is idiomatic
similar_names = "allow" # shard/shard_idx clear in context
too_many_lines = "allow" # Some init functions are long but linear
struct_excessive_bools = "allow" # Config structs need many options
# API design
must_use_candidate = "allow" # Prefer explicit #[must_use]
return_self_not_must_use = "allow" # Builder pattern returns Self
missing_errors_doc = "allow" # Panic-based error handling
missing_panics_doc = "allow" # Panics are for invariant violations
# Unsafe code (already have SAFETY comments)
multiple_unsafe_ops_per_block = "allow" # Sometimes needed for atomicity
# Pedantic style preferences
doc_markdown = "allow" # Allow flexibility in doc formatting
option_if_let_else = "allow" # Sometimes more readable
[dependencies]
parking_lot = "0.12.5"
region = "3.0"
# Optional tokio-uring support
[target.'cfg(target_os = "linux")'.dependencies]
tokio-uring = { version = "0.5", optional = true }
[dev-dependencies]
criterion = "0.7"
sharded-slab = "0.1"
bytes = "1.5"
lifeguard = "0.6"
deadpool = "0.12"
tokio = { version = "1", features = ["rt", "macros"] }
object-pool = "0.6"
[features]
default = []
tokio-uring = ["dep:tokio-uring"]
[profile.profiling]
inherits = "release"
debug = true
[[bench]]
name = "pool_comparison"
harness = false
[[bench]]
name = "allocation_patterns"
harness = false
[[bench]]
name = "cache_behavior"
harness = false
[[bench]]
name = "memory_features"
harness = false
[[bin]]
name = "ml_checkpoint_loader"
path = "profiling/ml_checkpoint_loader.rs"
[[bin]]
name = "network_server"
path = "profiling/network_server.rs"
[[bin]]
name = "file_pipeline"
path = "profiling/file_pipeline.rs"
[[bin]]
name = "stress_test"
path = "profiling/stress_test.rs"