diff --git a/.envrc b/.envrc index 672c57b..514e4a6 100644 --- a/.envrc +++ b/.envrc @@ -1,4 +1,5 @@ layout poetry +export LINE_PROFILE=1 export MAIL_PASSWORD="ewacyay5seu2qske" export MAIL_PORT=587 export MAIL_SERVER="smtp.fastmail.com" diff --git a/app/models.py b/app/models.py index cedbc7e..7082b06 100644 --- a/app/models.py +++ b/app/models.py @@ -8,6 +8,7 @@ import sys # PyQt imports # Third party imports +import line_profiler from sqlalchemy import ( bindparam, delete, @@ -563,6 +564,7 @@ class PlaylistRows(dbtables.PlaylistRowsTable): ) @staticmethod + @line_profiler.profile def update_plr_row_numbers( session: Session, playlist_id: int, sqla_map: List[dict[str, int]] ) -> None: diff --git a/app/musicmuster.py b/app/musicmuster.py index 800eb1e..0cc3cb0 100755 --- a/app/musicmuster.py +++ b/app/musicmuster.py @@ -44,6 +44,7 @@ from PyQt6.QtWidgets import ( ) # Third party imports +import line_profiler import pipeclient from pygame import mixer from sqlalchemy.exc import IntegrityError @@ -1068,7 +1069,8 @@ class Window(QMainWindow, Ui_MainWindow): else: webbrowser.get("browser").open_new_tab(url) - def paste_rows(self) -> None: + @line_profiler.profile + def paste_rows(self, dummy_for_profiling=None) -> None: """ Paste earlier cut rows. """ diff --git a/app/playlistmodel.py b/app/playlistmodel.py index 76f3e53..0a3a06a 100644 --- a/app/playlistmodel.py +++ b/app/playlistmodel.py @@ -26,6 +26,7 @@ from PyQt6.QtGui import ( ) # Third party imports +import line_profiler import obswebsocket # type: ignore # import snoop # type: ignore @@ -736,7 +737,8 @@ class PlaylistModel(QAbstractTableModel): self.update_track_times() self.invalidate_rows(row_numbers) - def move_rows(self, from_rows: list[int], to_row_number: int) -> None: + @line_profiler.profile + def move_rows(self, from_rows: list[int], to_row_number: int, dummy_for_profiling=None) -> None: """ Move the playlist rows given to to_row and below. """ @@ -986,7 +988,8 @@ class PlaylistModel(QAbstractTableModel): # Update display self.invalidate_row(track_sequence.previous.row_number) - def refresh_data(self, session: db.session) -> None: + @line_profiler.profile + def refresh_data(self, session: db.session, dummy_for_profiling=None) -> None: """Populate dicts for data calls""" # Populate self.playlist_rows with playlist data