forked from 5ec1cff/TrickyStore
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathcommit_message.txt
More file actions
12 lines (10 loc) · 1.1 KB
/
commit_message.txt
File metadata and controls
12 lines (10 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
⚡ Bolt: Replace Regex with allocation-free manual string validation loops in WebServer and KeyboxVerifier
This change introduces manual loops without intermediate allocations for string validations:
- Replaced various regex usages (e.g. `PKG_NAME_REGEX`, `FILENAME_REGEX`, etc.) in `WebServer.kt` with explicit index-based loops to prevent heap allocations.
- Fixed an issue where `isWhitespace` regex splits/matches caused temporary string allocations in WebServer requests processing.
- Replaced `.toString(16).lowercase()` with just `.toString(16)` because BigInteger string generation naturally emits lowercase strings, avoiding additional allocations.
- Re-enabled profile optimizations for Rust `Cargo.toml`.
Microsecond and kilobyte savings:
- Avoids repetitive allocations of matchers/pattern objects in hot paths, saving microseconds per web server request.
- BigInteger `.lowercase()` avoidance saves a string allocation (~24 bytes per call) and scanning overhead during CRL verifications.
- Rust `.so` binary size will be substantially smaller due to `lto="fat"`, `opt-level="z"`, and `strip=true` optimizations.