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

Make Exporter's preview a smoother experience #222

Merged
merged 1 commit into from
Jul 24, 2024
Merged

Conversation

soininen
Copy link
Contributor

@soininen soininen commented Jul 24, 2024

This PR makes Exporter's Specification editor run much smoother while updating the preview tables. Since they do not freeze the UI anymore, previews are enable by default now. If we experience unresponsive UI again, we can change the default back to disabled.

Fixes spine-tools/Spine-Toolbox#2898

Checklist before merging

  • Documentation (also in Toolbox repo) is up-to-date
  • Release notes in Toolbox repo have been updated
  • Unit tests have been added/updated accordingly
  • Code has been formatted by black & isort
  • Unit tests pass

PreviewUpdater was using QThreads to write the preview tables
which made the Specification editor unresponsive especially when
dealing with large number of tables. Also, it could deadlock when
multiple threads accessed the same database via multiple
DatabaseMappings (this is actually a spinedb_api issue).

This replaces the QThreads by a single worker process.
Because the tables are written in a separate process, we don't
encounter Python's global interpreter lock.

Re #2898
Copy link

codecov bot commented Jul 24, 2024

Codecov Report

Attention: Patch coverage is 48.68421% with 39 lines in your changes missing coverage. Please review.

Project coverage is 62.43%. Comparing base (75e4c7d) to head (d12024c).

Files Patch % Lines
spine_items/exporter/widgets/preview_updater.py 48.00% 35 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #222      +/-   ##
==========================================
+ Coverage   62.40%   62.43%   +0.02%     
==========================================
  Files         168      168              
  Lines       17833    17864      +31     
  Branches     2981     2994      +13     
==========================================
+ Hits        11129    11153      +24     
- Misses       6098     6101       +3     
- Partials      606      610       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@soininen soininen changed the title Make Exporter's preview smoother experience Make Exporter's preview a smoother experience Jul 24, 2024
@soininen soininen merged commit 90e447c into master Jul 24, 2024
11 of 12 checks passed
@soininen soininen deleted the 2898_exporter_freeze branch July 24, 2024 06:53
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.

Live preview in exporter editor freezes Toolbox
1 participant