v0.34.0_4
This commit is contained in:
1 parent
f20c8da718
commit
5910e6e901
21 files changed
+377
-51
No files matched your search
@@ -1,5 +1,12 @@
|
||||
# Live performance and regression harness
|
||||
|
||||
## DEV OPT3 / 1 KiB response: uncompiled source
|
||||
|
||||
`docs/PROXY_1KB_OPT3_DEV_0.34.0.md` describes 7 optimized hot-path sites
|
||||
and how to benchmark their **newly rebuilt** executable. Baseline
|
||||
`rust-proxy(2)` passed 89 real proxy/policy/cache checks. This runtime result
|
||||
is not evidence that uncompiled OPT3 changes work, nor a measured OPT3 RPS gain.
|
||||
|
||||
These scripts exercise actual RustProxy executables through loopback sockets.
|
||||
They do not simulate Rust request handling. The Python server in `peer.py` is a
|
||||
controllable test **upstream**, used to verify streaming, non-replayable writes,
|
||||
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Source-only regression guards for the OPT3 patch (NOT a Rust compile)."""
|
||||
from pathlib import Path
|
||||
root = Path(__file__).resolve().parents[2]
|
||||
|
||||
def read(name):
|
||||
return (root / name).read_text(encoding='utf-8')
|
||||
|
||||
assert 'version = "0.34.0"' in read('Cargo.toml')
|
||||
acl = read('src/acl.rs')
|
||||
assert "pub fn routing_path_view(raw: &str)" in acl
|
||||
assert "return routing_path(raw).map(std::borrow::Cow::Owned)" in acl
|
||||
assert 'raw.split' in acl and 'raw.len() <= 8192' in acl
|
||||
forward = read('src/proxy/forward_entry.rs')
|
||||
assert 'let routing_uri = request.uri().clone();' in forward
|
||||
assert 'crate::acl::routing_path_view(routing_uri.path())' in forward
|
||||
assert 'if context.client_ip != peer.0.ip()' in forward
|
||||
route = read('src/proxy/cache_helpers.rs')
|
||||
assert 'crate::acl::routing_path_view(request.uri().path())' in route
|
||||
for name in ('src/proxy/forward/cache_lookup.rs', 'src/proxy/forward/success_finish.rs', 'src/proxy/forward/web_source.rs'):
|
||||
assert 'path.clone()' not in read(name), name
|
||||
assert 'if !trusted_peer' in read('src/forwarding.rs')
|
||||
assert 'let mut ips = chain(incoming).unwrap_or_default();' in read('src/forwarding.rs')
|
||||
headers = read('src/proxy/headers.rs')
|
||||
assert 'let only_keep_alive' in headers
|
||||
assert 'let nominated: Vec<HeaderName>' in headers
|
||||
assert 'headers.remove(name)' in headers
|
||||
assert 'String::from_utf8(encoded)' in read('src/proxy/request_id.rs')
|
||||
assert 'if reason == "cache_disabled"' in read('src/cache/stats.rs')
|
||||
assert not read('src/cache/stats.rs').startswith('//!') # previous E0753 build issue
|
||||
for name in ('src/acl/tests.rs', 'src/proxy/headers/tests.rs', 'src/forwarding/tests.rs'):
|
||||
assert (root / name).exists()
|
||||
for source in (root / 'src').rglob('*.rs'):
|
||||
if '/tests/' in source.as_posix() or source.name == 'tests.rs':
|
||||
continue
|
||||
assert len(source.read_text(encoding='utf-8').splitlines()) <= 500, source
|
||||
print('PASS OPT3 source guards (STATIC ONLY; not cargo check, live HTTP or throughput)')
|
||||
Reference in new issue
Block a user