Open
Conversation
Member
hadley
commented
Mar 20, 2026
Add a fast grepl() pre-check to avoid expensive XML parsing for the
99% of tags that don't contain inline R code (`r ...` or ```{...}).
Saves ~12ms per roxygenize() run (11x faster for markdown_evaluate).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add fast grepl() pre-check in escape_rd_for_md() to skip expensive regex search and string manipulation when text contains no Rd macros. Saves ~28ms per roxygenize() run (92x faster per call for plain text). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add an environment-based cache for is_s3_generic() that is active only during roxygenize() runs. With 729 calls and 301 unique names (59% redundancy), this saves ~3ms per run. Cache is cleared after each run to avoid cross-environment contamination. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The stringr wrapper adds ~12µs overhead per call for a simple fixed-character split. With 280 calls per run, this saves ~3.4ms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add fast grepl() pre-check in get_md_linkrefs() to avoid expensive str_match_all() regex when text contains no [ character. Saves ~4.5ms per roxygenize() run (205 of 240 calls skip the regex). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
End-to-end roxygenize() on roxygen2: 936ms -> 839ms (10.4% faster). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
I've tested this quite eagerly on Luminescence, and unfortunately I have to report a minor slow down compared to the current |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.