Skip to content

Improve GUI startup time#962

Merged
Josef-Haupt merged 1 commit into
mainfrom
startup
Jul 21, 2026
Merged

Improve GUI startup time#962
Josef-Haupt merged 1 commit into
mainfrom
startup

Conversation

@Josef-Haupt

Copy link
Copy Markdown
Member

Just small improvements sadly nothing major

Copilot AI review requested due to automatic review settings July 21, 2026 10:30
@Josef-Haupt Josef-Haupt changed the title Improve GUI startip time Improve GUI startup time Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to improve GUI startup time by deferring heavyweight imports until they’re actually needed during user interactions, reducing initial module import cost when launching the GUI.

Changes:

  • Lazy-load birdnet_analyzer.audio in the single-file GUI tab only when audio operations are triggered.
  • In the evaluation GUI tab, defer imports of matplotlib, process_data, and DataProcessor until the related actions run.
  • Add from __future__ import annotations and TYPE_CHECKING-guarded imports to keep runtime imports light while preserving type hints.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
birdnet_analyzer/gui/single_file.py Removes eager audio import and performs local imports in the two callbacks that actually read audio data.
birdnet_analyzer/gui/evaluation.py Defers heavier evaluation/plotting imports to action handlers; uses postponed annotations + TYPE_CHECKING to avoid runtime type-import costs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Josef-Haupt
Josef-Haupt merged commit b1d866b into main Jul 21, 2026
9 of 21 checks passed
@Josef-Haupt
Josef-Haupt deleted the startup branch July 21, 2026 11:08
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