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

Memoize result value in Utilities.getremote #1838

Merged
merged 1 commit into from
Jun 5, 2022
Merged

Conversation

fredrikekre
Copy link
Member

@fredrikekre fredrikekre commented Jun 3, 2022

Utilities.getremote is called when figuring out the URL to methods while
rendering the documentation. A profile of makedocs for Documenters docs
showed that almost a third of the collected samples was inside getremote,
and in particular in the spawned process to git. This patch memoizes the
result of getremote. This should give noticeable improvements, since
this function is often often called with the same argument.

@mortenpi
Copy link
Member

mortenpi commented Jun 3, 2022

Looks reasonable to me, could just use a small CHANGELOG note.

Utilities.getremote is called when figuring out the URL to methods while
rendering the documentation. A profile of makedocs for Documenters docs
showed that almost a third of the collected samples was inside
getremote, and in particular in the spawned process to git. This patch
memoizes the result of getremote (on a per-source-file basis). This
should give noticeable improvements, since this function is often often
called with the same argument.
@fredrikekre fredrikekre merged commit 14c1ef2 into master Jun 5, 2022
@fredrikekre fredrikekre deleted the fe/cache-remote branch June 5, 2022 11:15
fredrikekre added a commit that referenced this pull request Jun 5, 2022
Utilities.getremote is called when figuring out the URL to methods while
rendering the documentation. A profile of makedocs for Documenters docs
showed that almost a third of the collected samples was inside
getremote, and in particular in the spawned process to git. This patch
memoizes the result of getremote (on a per-source-file basis). This
should give noticeable improvements, since this function is often often
called with the same argument.

(cherry picked from commit 14c1ef2)
fredrikekre added a commit that referenced this pull request Jun 5, 2022
Utilities.getremote is called when figuring out the URL to methods while
rendering the documentation. A profile of makedocs for Documenters docs
showed that almost a third of the collected samples was inside
getremote, and in particular in the spawned process to git. This patch
memoizes the result of getremote (on a per-source-file basis). This
should give noticeable improvements, since this function is often often
called with the same argument.

(cherry picked from commit 14c1ef2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants