8000 Rely more on lru_cache rather than custom caching. by anntzer · Pull Request #9677 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Rely more on lru_cache rather than custom caching. #9677

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

Merged
merged 2 commits into from
Nov 10, 2017

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Nov 4, 2017

PR Summary

All's in the title.

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer changed the title Rely more on lru_cache in font_manager rather than custom caching. Rely more on lru_cache rather than custom caching. Nov 4, 2017
@jklymak
Copy link
Member
jklymak commented Nov 4, 2017

@anntzer is this a soln to #9548?

@anntzer
Copy link
Contributor Author
anntzer commented Nov 4, 2017

No, but I noticed the possibility of this improvement while reviewing your PR.

return result
return False
with open(filename, 'rb') as fd:
tag = fd.read(4)
Copy link
Member

Choose a reason for hiding this comment

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

            return fd.read(4) == b'OTTO'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

prop, fontext, directory, fallback_to_default, rebuild_if_missing,
tuple(tuple(rcParams[key]) for key in [
"font.serif", "font.sans-serif", "font.cursive",
"font.fantasy", "font.monospace"]))
Copy link
Member

Choose a reason for hiding this comment

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

This inlining...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deinlined :)

@tacaswell tacaswell added this to the v2.2 milestone Nov 10, 2017
@tacaswell tacaswell merged commit 5730794 into matplotlib:master Nov 10, 2017
@tacaswell
Copy link
Member

Thanks @anntzer !

Good to see you around reviewing again @Kojoley

@anntzer anntzer deleted the more-lru_cache branch November 10, 2017 03:24
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
tacaswell added a commit to tacaswell/matplotlib that referenced this pull request Mar 16, 2018
This reverts commit 5730794, reversing
changes made to 1ca3d1a.

Fixes matplotlib#10740 by avoiding suspected bugs in backports.lru_cache
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.

5 participants
0