Skip to content

Scan time budget and performance monitor add CPU on every pattern check #62

Closed

Description

@rennf93

Every pattern check pays for the scan time budget: checkRegexPatterns reads ThreadMXBean.currentThreadCpuTime twice per pattern check, and so does the fallback scan. The performance monitor also copies the recent-times window twice and allocates a list for the variance on every record, and sanitizes each anomaly before it knows whether any callback is registered. The Python reference engine fixed the same overhead in Guard-Core/guard-core#172. I am charging the budget per pass at 2 ms slice boundaries and making the monitor statistics allocation-free.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed defect

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions