twisted / pydoctor

This is pydoctor, an API documentation generator that works by static analysis.
https://pydoctor.readthedocs.io
Other
179 stars 48 forks source link

A few optimizations #714

Closed tristanlatr closed 1 year ago

tristanlatr commented 1 year ago

After analyzing https://www.speedscope.app/#profileURL=https://gist.githubusercontent.com/dreid/8f14c18b468c67376dfe005d09a76238/raw/d9addc3d169b83281ad22f81aa8d1f4dec9966d6/pydoctor.speedscope I've tried to improve the performance of a few key functions. Probably the major benefit will be in the get_all_documents_flattenable refactors, it was allocating a big list where it did not have to

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.06 :warning:

Comparison is base (301d239) 92.56% compared to head (18fe81d) 92.51%.

:exclamation: Current head 18fe81d differs from pull request most recent head 2169bcb. Consider uploading reports for the commit 2169bcb to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #714 +/- ## ========================================== - Coverage 92.56% 92.51% -0.06% ========================================== Files 47 47 Lines 8129 8124 -5 Branches 1942 1941 -1 ========================================== - Hits 7525 7516 -9 - Misses 347 354 +7 + Partials 257 254 -3 ``` | [Impacted Files](https://app.codecov.io/gh/twisted/pydoctor/pull/714?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=twisted) | Coverage Δ | | |---|---|---| | [pydoctor/node2stan.py](https://app.codecov.io/gh/twisted/pydoctor/pull/714?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=twisted#diff-cHlkb2N0b3Ivbm9kZTJzdGFuLnB5) | `96.64% <100.00%> (ø)` | | | [pydoctor/templatewriter/pages/sidebar.py](https://app.codecov.io/gh/twisted/pydoctor/pull/714?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=twisted#diff-cHlkb2N0b3IvdGVtcGxhdGV3cml0ZXIvcGFnZXMvc2lkZWJhci5weQ==) | `99.01% <100.00%> (-0.01%)` | :arrow_down: | | [pydoctor/templatewriter/search.py](https://app.codecov.io/gh/twisted/pydoctor/pull/714?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=twisted#diff-cHlkb2N0b3IvdGVtcGxhdGV3cml0ZXIvc2VhcmNoLnB5) | `96.25% <100.00%> (-0.05%)` | :arrow_down: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/twisted/pydoctor/pull/714/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=twisted)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

tristanlatr commented 1 year ago

I’ll merge this PR next week if there is still no review