Skip to content

perf(ioc): avoid allocation-heavy match deduplication - #590

Merged
Karib0u merged 3 commits into
mainfrom
claude/rustinel-issue-436-a2ee2d
Sep 21, 2026
Merged

Karib0u merged 3 commits into
mainfrom
claude/rustinel-issue-436-a2ee2d

Conversation

@Karib0u

@Karib0u Karib0u commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #526 and related to #436.

Replace formatted-string HashSet deduplication with direct comparison against the small list of IOC matches already collected. Duplicate matches are rejected before allocating their owned strings. Hash observables now use an inline three-entry SmallVec, one slot per supported algorithm.

The IOC benchmark now covers event misses, hits for every event-matched indicator kind, computed hash hits and misses, and events evaluated by a hash-only feed.

Type of change

  • feat / enhancement - new feature
  • performance - performance improvement
  • bug - bug fix
  • refactor - refactoring, no behaviour change
  • documentation - docs only
  • ci - CI and release changes
  • dependencies - dependency update
  • chore - other maintenance
  • breaking-change - breaking change
  • skip-changelog - release preparation or changes with no release-note value

Test plan

  • Tested on Windows
  • Tested on Linux
  • Targeted IOC tests pass: cargo test ioc --all-features
  • Strict lint passes: cargo clippy --all-targets --all-features -- -D warnings
  • IOC benchmark coverage extended

Checklist

  • Label added to this PR
  • Docs updated if behaviour changed: no behaviour change
  • Generated docs refreshed if CLI flags or config options changed: not applicable
  • Release highlights and upgrade notes added: release preparation only

Replace the formatted-key HashSet dedupe with a direct comparison against the matches already collected, checked before any string of the new match is allocated. Hash observables are collected into a three-slot SmallVec.

Extend benches/ioc_observables.rs with hash feeds, match_hashes hit and miss, one hit case per event-matched kind, and events checked by a hash-only feed.
@Karib0u Karib0u added the performance Performance and memory improvements label Sep 21, 2026
@Karib0u
Karib0u merged commit cd28c75 into main Sep 21, 2026
14 checks passed
@Karib0u
Karib0u deleted the claude/rustinel-issue-436-a2ee2d branch September 21, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance and memory improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant