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

Small perf improvements #1309

Merged
merged 4 commits into from
Jul 20, 2019
Merged

Small perf improvements #1309

merged 4 commits into from
Jul 20, 2019

Conversation

sloria
Copy link
Member

@sloria sloria commented Jul 18, 2019

Just a few free micro-optimizations. Results in ~3% improvement in dump speed, using tox -e benchmark.

  • Memoize _has_processors
  • Don't make intermediate list
  • Duck-type iterables

* Memoize _has_processors
* Don't make intermediate list
* Duck-type iterables
@lafrech
Copy link
Member

lafrech commented Jul 18, 2019

LGTM.

TIL about functools.lru_cache.

@sloria sloria merged commit cc64b91 into dev Jul 20, 2019
@sloria sloria deleted the small-optims branch July 20, 2019 16:09
@sloria sloria added this to the 3.0 milestone Jul 20, 2019
@mrcljx mrcljx mentioned this pull request Jun 5, 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.

2 participants