-
Notifications
You must be signed in to change notification settings - Fork 186
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
Move symbol search into XPath in backport_linter #2365
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2365 +/- ##
=======================================
Coverage 99.13% 99.13%
=======================================
Files 124 124
Lines 5573 5573
=======================================
Hits 5525 5525
Misses 48 48 ☔ View full report in Codecov by Sentry. |
Sounds like #2357 promises better performance than this approach in the long run. |
It will still need a Anyway it does seem like a broader issue, but my instinct is the affected cases will mostly be looking at |
BTW, this at least partially seems related to our XPath1.0 restriction, it would be great to to have an XPath2.0+ backend but I don't see any R support for that. LLM turned up this C++ library |
NB: |
This idea was implemented in #2357 as well now, so closing this PR. |
* add first implementation of xml_find_function_calls * delint * support getting all function calls and using names. * squash conversions * review comments * clean up * add vignette section and NEWS bullet * smarter conjunct_test_linter migration * smarter consecutive_assertion_linter migration * remove self::SYMBOL_FUNCTION_CALL[text() = ...] xpaths * delint * Update expect_s3_class_linter.R * Reference GH issue # in TODO * review comments * add missing comma in example * Update NEWS.md * supersede #2365 * Update R/xp_utils.R Co-authored-by: Michael Chirico <[email protected]> * fix bad commit * Update NEWS.md * Add an upper bound improvement from r-devel --------- Co-authored-by: Michael Chirico <[email protected]> Co-authored-by: Michael Chirico <[email protected]>
For #2338. This approach presents a bit of a conundrum as it seems the performance of the XPath algorithm degrades with the number of objects to search for:
(
new
: this PR;old
: currentmain
.413
:backport_linter("4.1.3")
;300
:backport_linter("3.0.0")
)i.e. we get about 10% improvement from the "easier" linter where there are fewer objects to look up, but 7% slowdown in the "harder" case with many objects to look up.
Not sure how to proceed. We may also want to check other linters that use a huge list of
or
checks & check alternate approaches.