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

refactor(agent): improve magic file recognition performance #970

Merged

Conversation

lavarou
Copy link
Member

@lavarou lavarou commented Oct 7, 2024

Speed up speed package detection by performing a suffix match on the 'magic' file pattern with case insensitive string comparison instead of a substring search within a lowercased filename. This is possible because all of the 'magic' file search patterns patterns are right anchored.

Fixup of e11b992 with changes from 24c1c65.

Speed up speed package detection by performing a suffix match on the 'magic'
file pattern with case insensitive string comparison instead of a substring
search within a lowercased filename. This is possible because all of the 'magic'
file search patterns patterns are right anchored.

Fixup of e11b992 with changes from 24c1c65.
@lavarou lavarou requested a review from zsistla October 7, 2024 20:25
@newrelic-php-agent-bot
Copy link

newrelic-php-agent-bot commented Oct 7, 2024

Test Suite Status Result
Multiverse 7/7 passing
SOAK 56/56 passing

@codecov-commenter
Copy link

codecov-commenter commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.54%. Comparing base (aa15a2d) to head (30fac1a).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #970   +/-   ##
=======================================
  Coverage   78.53%   78.54%           
=======================================
  Files         196      196           
  Lines       27108    27103    -5     
=======================================
- Hits        21290    21287    -3     
+ Misses       5818     5816    -2     
Flag Coverage Δ
agent-for-php-7.2 78.55% <100.00%> (+<0.01%) ⬆️
agent-for-php-7.3 78.57% <100.00%> (+<0.01%) ⬆️
agent-for-php-7.4 78.27% <100.00%> (+<0.01%) ⬆️
agent-for-php-8.0 78.29% <100.00%> (+<0.01%) ⬆️
agent-for-php-8.1 78.28% <100.00%> (+<0.01%) ⬆️
agent-for-php-8.2 77.87% <100.00%> (+<0.01%) ⬆️
agent-for-php-8.3 77.87% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Contributor

@zsistla zsistla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice optimization

@lavarou lavarou merged commit f9530ed into dev Oct 8, 2024
55 checks passed
@lavarou lavarou deleted the refactor/vm/improve-magic-file-recognition-performance branch October 8, 2024 02:58
@zsistla zsistla added this to the next-release milestone Oct 18, 2024
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.

4 participants