Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kaizen: add analyzer, misc cleanup #326

Merged
merged 1 commit into from
Jun 30, 2024
Merged

kaizen: add analyzer, misc cleanup #326

merged 1 commit into from
Jun 30, 2024

Conversation

timbray
Copy link
Owner

@timbray timbray commented Jun 28, 2024

This adds the function analyze() to coreMatcher. It visits all of the fieldMatcher and valueMatcher states and gathers statistics (at the moment, just the maximum nondeterministic concurrency). For the moment, this is strictly an (extremely useful) tool for developers trying to optimize NFA construction/traversal.

Its output could be used in practice to increase the performance of the pathological case illustrated by TestShellStyleBuildTime(), which slows down to <10K/second when you add 13K wildcard patterns, but that
particular optimization requires much more thinking.

No public API yet, but this could evolve into something similar to Ruler's MachineComplexityEvaluator public API although I'm not happy with the metric that API generates.

Also in this commit: Miscellaneous code cleanups including fixing a new lint problem detected by recent golangci-lint, and restoring tests that had been commented out because of the NFA state explosion.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 86.95652% with 6 lines in your changes missing coverage. Please review.

Project coverage is 96.48%. Comparing base (ec60e13) to head (21975ae).

Files Patch % Lines
field_matcher.go 42.85% 2 Missing and 2 partials ⚠️
nfa.go 77.77% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #326      +/-   ##
==========================================
- Coverage   96.54%   96.48%   -0.06%     
==========================================
  Files          18       18              
  Lines        1735     1764      +29     
==========================================
+ Hits         1675     1702      +27     
  Misses         35       35              
- Partials       25       27       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@timbray timbray merged commit 0a8726c into main Jun 30, 2024
7 checks passed
@timbray timbray deleted the analyze-cleanup branch June 30, 2024 15:55
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.

2 participants