Skip to content

Conversation

@tastyfrankfurt
Copy link
Owner

No description provided.

@tastyfrankfurt tastyfrankfurt changed the title feat(sast): Policy and Sandbox scan firt release. feat(sast): Policy and Sandbox scan first release. Jul 15, 2025
@tastyfrankfurt tastyfrankfurt self-assigned this Jul 16, 2025
@tastyfrankfurt tastyfrankfurt merged commit 784f02b into main Jul 16, 2025
2 checks passed
@tastyfrankfurt tastyfrankfurt deleted the feat/improvements branch July 16, 2025 11:20
tastyfrankfurt pushed a commit that referenced this pull request Oct 26, 2025
Optimization #1: Replace Vec with Arc in ServiceConfig
- Changed audit_actions and action_types from Vec<String> to Arc<[String]>
- Eliminates N vector clones per service cycle (where N = number of chunks)
- Arc clones are O(1) reference count increments vs O(n) data copies
- Updated service.rs, audit.rs, main.rs to use Arc

Optimization #2: Use Cow to reduce JSON clones in deduplication
- Changed deduplicated_data to use Cow<serde_json::Value>
- Eliminates unnecessary clones when skip_dedup is true
- Borrows data when possible, only owns when deduplication modifies it
- Reduces allocations in output.rs write_audit_log_file()

Performance impact:
- Service mode with 15min chunks over 2 hours: ~8-16 fewer vector clones
- No-dedup mode: Eliminates 1 large JSON clone per write
- Combined savings: ~160+ allocations per service cycle in typical usage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant