randovania / open-prime-rando

Open Source randomizer patcher for Metroid Prime 2 and eventually 3.
GNU General Public License v3.0
2 stars 7 forks source link

Delay importing DoorMapIcon for performance #48

Closed henriquegemignani closed 1 year ago

duncathan commented 1 year ago

I'm surprised this is a slow import tbh

henriquegemignani commented 1 year ago

Loads stuff that loads stuff that loads properties from RDS, and that's slow.

henriquegemignani commented 1 year ago
└─ 1.514 <module>  open_prime_rando\echoes\dock_lock_rando\__init__.py:1
   ├─ 0.823 <module>  retro_data_structures\formats\__init__.py:1
   │  ├─ 0.686 <module>  retro_data_structures\formats\room.py:1
   │  │  └─ 0.682 <module>  retro_data_structures\properties\prime_remastered\objects\__init__.py:1
   │  │     ├─ 0.081 [self]  None
   │  │     ├─ 0.069 stat  None
   │  │     │     [2 frames hidden]  <built-in>
   │  │     └─ 0.043 <module>  retro_data_structures\properties\prime_remastered\objects\RippleMP1.py:1
   │  │        └─ 0.043 RippleMP1  retro_data_structures\properties\prime_remastered\objects\RippleMP1.py:11
   │  └─ 0.099 <module>  retro_data_structures\formats\mlvl.py:1
   │     └─ 0.094 <module>  retro_data_structures\formats\mrea.py:1
   │        └─ 0.082 <module>  retro_data_structures\formats\script_layer.py:1
   │           └─ 0.082 <module>  retro_data_structures\formats\script_object.py:1
   │              └─ 0.077 <module>  retro_data_structures\enums\helper.py:1
   └─ 0.688 <module>  open_prime_rando\echoes\dock_lock_rando\dock_type.py:1
      └─ 0.647 <module>  retro_data_structures\properties\echoes\objects\__init__.py:1
         └─ 0.073 <module>  retro_data_structures\properties\echoes\objects\PlantScarabSwarm.py:1
            └─ 0.072 __new__  <frozen abc>:105
                  [3 frames hidden]  <frozen abc>, <built-in>
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (fb4eb11) 76.47% compared to head (e18c257) 76.47%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #48 +/- ## ======================================= Coverage 76.47% 76.47% ======================================= Files 27 27 Lines 1152 1152 ======================================= Hits 881 881 Misses 271 271 ``` | [Impacted Files](https://app.codecov.io/gh/randovania/open-prime-rando/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=randovania) | Coverage Δ | | |---|---|---| | [...pen\_prime\_rando/dol\_patching/echoes/dol\_patches.py](https://app.codecov.io/gh/randovania/open-prime-rando/pull/48?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=randovania#diff-c3JjL29wZW5fcHJpbWVfcmFuZG8vZG9sX3BhdGNoaW5nL2VjaG9lcy9kb2xfcGF0Y2hlcy5weQ==) | `98.90% <100.00%> (ø)` | |

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