03-03-2022, 11:17 AM | #16 |
Well trained by Cats
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Things that need to be 'calculated', rather than looked up (read direct), will slow things down.
Any formula (column value), Any column Icon or color needs additional processing after the DATA from the DB has been read. (I will assume the same applies to Grid View, which I do not use) |
03-03-2022, 04:59 PM | #17 |
null operator (he/him)
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Since we're talking about Virtual Library switching and we've eliminated most everything else, my suspicions have fallen on the VL search expressions, mine are simple. I guess there are performance implications if they're complex.
One way to test this would be to switch directly from a restricted VL to the All Books VL. For me that's Ctrl+Alt+Up-arrow. But that's a customised setting. On Windows the default shortcut, Ctrl+Esc, doesn't work because Microsoft uses it to show the Start Menu. As an ardent user of keyboard shortcuts why anyone would use that sequence for anything other than 'Get me outta here… Now!' escapes me. Maybe others know of search expression examples that could be used in a VL, which have performance implications. chaley? BR |
Advert | |
|
03-04-2022, 04:55 AM | #18 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
One exception: I have seen slow searches when the comments columns contains huge amounts of text, the searches aren't prefixed, and the columns-to-search when prefixes aren't used isn't set (Preferences / Search / Limit the searched metadata. In one case the person was copying most of the book into the comments. |
|
03-04-2022, 04:31 PM | #19 | |
null operator (he/him)
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
If that solves the problem I'll move this convo to fresh a Lib Mgt sub-forum thread. BR |
|
03-04-2022, 06:13 PM | #20 | ||
Connoisseur
Posts: 51
Karma: 198
Join Date: Feb 2022
Device: Kindle PW5/11th Gen
|
Quote:
Quote:
All my search expressions are simple:
I've run a ton of tests in the portable version: loaded a copy of my current library, tried removing all kinds of columns and metadata, tried creating smaller new libraries from scratch and adding custom columns to those, then making different VM views... The fastest setup was when I dropped 25 eBook files directly into a new, clean library; didn't add any custom columns; made some VM views. Switching between those VM views was fast. Not instant, but faster than a second. I also tried making a new library and importing my full original library (with settings) into it, then deleting all but 30 books. Still slow. A little faster than my original install, but still a couple of seconds. Honestly I'm driving myself a bit batty with all the testing, so I'm probably just going to give up and live with it. I really appreciate everyone's help and suggestions, though! |
||
Advert | |
|
03-04-2022, 06:33 PM | #21 | |||
null operator (he/him)
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Quote:
Quote:
BR |
|||
03-04-2022, 07:06 PM | #22 |
Plugin Developer
Posts: 6,328
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
I don't know if it will actually help any, but here's a quick and dirty version of VM that spits out some times between different events.
You have to run in debug to see the output and look at the code to see what it means, but it should pinpoint exactly where the time is going. From VM's point of view that is. I have every expectation that the longest time for basically everyone will be where I see it: "7.4" self.gui.library_view.apply_state(...) which sets the viewable columns and sorts. Look for the self.print_timediff(...) calls in action.py. |
03-05-2022, 03:32 PM | #23 | ||
Connoisseur
Posts: 51
Karma: 198
Join Date: Feb 2022
Device: Kindle PW5/11th Gen
|
Quote:
Code:
Traceback (most recent call last): File "calibre\gui2\ui.py", line 853, in library_moved File "calibre\db\legacy.py", line 187, in __init__ File "calibre\db\legacy.py", line 44, in create_backend File "calibre\db\backend.py", line 461, in __init__ File "calibre\db\backend.py", line 1213, in user_version File "calibre\db\backend.py", line 926, in conn File "calibre\db\backend.py", line 339, in __init__ apsw.CantOpenError: CantOpenError: unable to open database file Quote:
Code:
calibre Debug log calibre 5.38 [64bit] embedded-python: True is64bit: True Windows-10-10.0.22000 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.22000') Python 3.8.5 Windows: ('10', '10.0.22000', '', 'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 47, 0) && DeDRM (10, 0, 2) && Package KFX (from KFX Input) (1, 47, 0) && Action Chains (1, 16, 3) && Annotations (1, 16, 0) && Count Pages (1, 11, 2) && FanFicFare (4, 10, 0) && Generate Cover (2, 1, 0) && KFX metadata reader (from KFX Input) (1, 47, 0) && KFX Input (1, 47, 0) && Set KFX metadata (from KFX Output) (1, 59, 0) && KFX Output (1, 59, 0) && KindleUnpack - The Plugin (0, 83, 1) && Obok DeDRM (10, 0, 0) && Reading List (1, 8, 0) && SmartEject (2, 4, 0) && View Manager (1, 7, 0) && WordDumb (3, 18, 4) calibre 5.38 [64bit] embedded-python: True is64bit: True Windows-10-10.0.22000 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.22000') Python 3.8.5 Windows: ('10', '10.0.22000', '', 'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 47, 0) && DeDRM (10, 0, 2) && Package KFX (from KFX Input) (1, 47, 0) && Action Chains (1, 16, 3) && Annotations (1, 16, 0) && Count Pages (1, 11, 2) && FanFicFare (4, 10, 0) && Generate Cover (2, 1, 0) && KFX metadata reader (from KFX Input) (1, 47, 0) && KFX Input (1, 47, 0) && Set KFX metadata (from KFX Output) (1, 59, 0) && KFX Output (1, 59, 0) && KindleUnpack - The Plugin (0, 83, 1) && Obok DeDRM (10, 0, 0) && Reading List (1, 8, 0) && SmartEject (2, 4, 0) && View Manager (1, 7, 0) && WordDumb (3, 18, 4) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 96.0 x 96.0 physicalDpi: 95.81139489194499 x 95.9160839160839 Using calibre Qt style: True [0.00] Starting up... [0.01] Showing splash screen... [0.44] splash screen shown [0.44] Initializing db... [0.47] db initialized [0.47] Constructing main UI... DEBUG: 0.0 Annotations plugin: Error loading libiMobileDevice. This hasn't worked for a while, and is blacklisted in calibre v3. DEBUG: 0.0 Annotations plugin: Error is: No module named 'calibre.devices.idevice' DEBUG: 0.0 Annotations::reader_app_support.py - loading translations DEBUG: 0.0 Annotations::common_utils.py - loading translations DEBUG: 0.0 Annotations::appearance.py - loading translations DEBUG: 0.0 Annotations::config.py - loading translations DEBUG: 0.0 Annotations::annotated_books.py - loading translations DEBUG: 0.0 Annotations::action.py - loading translations DEBUG: 0.0 obok::utilities.py - loading translations DEBUG: 0.0 obok::dialogs.py - loading translations DEBUG: 0.0 obok::config.py - loading translations DEBUG: 0.0 obok::action_err.py - loading translations [2.41] main UI initialized... [2.41] Hiding splash screen Action chains: _call_plugins_action_chains_resources(): start Action Chains: _call_plugins_action_chains_resources(): finished Action chains: formulas: running on_templates_update() Action chains: _call_plugins_on_modules_update(): start Action Chains: _call_plugins_on_modules_update(): finished Starting QuickView [3.98] splash screen hidden [3.98] Started up in 3.98 seconds with 227 books switch_view(All Books) 1:0.0 2:0.0 3:0.0 4:0.0 5:0.0 6:0.0 7.1:0.0 7.2:0.0 7.3:0.0 7.4:0.0 7.5:0.0 7.6:0.0 7.10:0.0 7:0.0 8:0.03127121925354004 9:0.0 10:0.0 switch_view(Fanfic) 1:0.0 2:0.015655994415283203 3:0.06296420097351074 4:0.0 5:0.0 6:0.0 7.1:0.0 7.2:0.0 7.3:0.0 7.4:1.192173957824707 7.5:0.07853269577026367 7.6:0.0 7.10:0.0 7:0.0 8:0.031271934509277344 9:0.0 10:0.0 switch_view(Manga) 1:0.0 2:0.0 3:0.10957932472229004 4:0.0 5:0.0 6:0.0 7.1:0.0 7.2:0.0 7.3:0.0 7.4:1.117962121963501 7.5:0.0 7.6:0.0 7.10:0.0 7:0.0 8:0.03127408027648926 9:0.0 10:0.0 switch_view(Prose) 1:0.0010290145874023438 2:0.0 3:0.06935787200927734 4:0.0 5:0.0 6:0.0 7.1:0.0 7.2:0.0 7.3:0.0 7.4:0.12209963798522949 7.5:0.015333890914916992 7.6:0.0 7.10:0.0 7:0.0 8:0.031244516372680664 9:0.0 10:0.0 switch_view(All Books) 1:0.0 2:0.0 3:0.11008644104003906 4:0.0 5:0.0 6:0.0 7.1:0.0 7.2:0.0 7.3:0.0 7.4:0.7217462062835693 7.5:0.0 7.6:0.0 7.10:0.0 7:0.0 8:0.03124237060546875 9:0.0 10:0.0 switch_view(Manga) 1:0.0 2:0.0 3:0.09266543388366699 4:0.0 5:0.0 6:0.0 7.1:0.0 7.2:0.0 7.3:0.0 7.4:0.8940434455871582 7.5:0.0 7.6:0.0 7.10:0.0 7:0.0 8:0.03124237060546875 9:0.0 10:0.0 switch_view(Fanfic) 1:0.0 2:0.0 3:0.07855987548828125 4:0.0 5:0.0 6:0.0 7.1:0.0 7.2:0.0 7.3:0.0 7.4:1.535933256149292 7.5:0.0 7.6:0.0 7.10:0.0 7:0.0 8:0.03168678283691406 9:0.0 10:0.0 switch_view(Prose) 1:0.0 2:0.0 3:0.15700888633728027 4:0.0 5:0.0 6:0.0 7.1:0.0 7.2:0.0 7.3:0.0 7.4:1.6943953037261963 7.5:0.015617609024047852 7.6:0.0 7.10:0.0 7:0.0 8:0.03121209144592285 9:0.0 10:0.005539655685424805 switch_view(All Books) 1:0.0 2:0.0 3:0.09420442581176758 4:0.0 5:0.0 6:0.0 7.1:0.0 7.2:0.0 7.3:0.0 7.4:0.7216336727142334 7.5:0.0 7.6:0.0 7.10:0.0 7:0.0 8:0.03173184394836426 9:0.0 10:0.0 Action Chains: Starting event: VL Tab Changed Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: VL View Action Chains: VL View: starting action No. 1: Switch To VL View debug1: vl: Fanfiction debug2: view: Fanfic 7.1:5.5109899044036865 7.2:0.0 7.3:0.0 7.4:2.2270941734313965 7.5:0.0 7.6:0.0 7.10:0.0 Action Chains: chain (VL View) finished in: 0:00:02.496662 Action Chains: Is db modified by event: True Action Chains: event (VL Tab Changed) finished in: 0:00:02.513281 Action Chains: Signal vl_tab_changed emitted Action Chains: Starting event: VL Tab Changed Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: VL View Action Chains: VL View: starting action No. 1: Switch To VL View debug1: vl: Manga debug2: view: Manga 7.1:2.437694787979126 7.2:0.0 7.3:0.0 7.4:1.8519632816314697 7.5:0.0 7.6:0.0 7.10:0.0 Action Chains: chain (VL View) finished in: 0:00:02.040398 Action Chains: Is db modified by event: True Action Chains: event (VL Tab Changed) finished in: 0:00:02.056019 Action Chains: Signal vl_tab_changed emitted Action Chains: Starting event: VL Tab Changed Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: VL View Action Chains: VL View: starting action No. 1: Switch To VL View debug1: vl: Prose debug2: view: Prose 7.1:3.3334391117095947 7.2:0.0 7.3:0.0 7.4:0.21960043907165527 7.5:0.0 7.6:0.0 7.10:0.0 Action Chains: chain (VL View) finished in: 0:00:00.423471 Action Chains: Is db modified by event: True Action Chains: event (VL Tab Changed) finished in: 0:00:00.439093 Action Chains: Signal vl_tab_changed emitted Action Chains: Starting event: VL Tab Changed Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: VL View Action Chains: VL View: starting action No. 1: Switch To VL View debug1: vl: _ALL_BOOKS debug2: view: All Books 7.1:3.4159934520721436 7.2:0.0 7.3:0.0 7.4:0.7062489986419678 7.5:0.0 7.6:0.0 7.10:0.0 Action Chains: chain (VL View) finished in: 0:00:01.015570 Action Chains: Is db modified by event: True Action Chains: event (VL Tab Changed) finished in: 0:00:01.033187 Action Chains: Signal vl_tab_changed emitted Action Chains: Starting event: VL Tab Changed Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: VL View Action Chains: VL View: starting action No. 1: Switch To VL View debug1: vl: Manga debug2: view: Manga 7.1:6.749933481216431 7.2:0.0 7.3:0.0 7.4:1.3303160667419434 7.5:0.015621662139892578 7.6:0.0 7.10:0.0 Action Chains: chain (VL View) finished in: 0:00:01.506669 Action Chains: Is db modified by event: True Action Chains: event (VL Tab Changed) finished in: 0:00:01.526304 Action Chains: Signal vl_tab_changed emitted Action Chains: Starting event: VL Tab Changed Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: VL View Action Chains: VL View: starting action No. 1: Switch To VL View debug1: vl: _ALL_BOOKS debug2: view: All Books 7.1:2.164708375930786 7.2:0.0 7.3:0.0 7.4:0.9017114639282227 7.5:0.007542610168457031 7.6:0.0 7.10:0.0 Action Chains: chain (VL View) finished in: 0:00:01.199462 Action Chains: Is db modified by event: True Action Chains: event (VL Tab Changed) finished in: 0:00:01.217078 Action Chains: Signal vl_tab_changed emitted Action Chains: Starting event: VL Tab Changed Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: VL View Action Chains: VL View: starting action No. 1: Switch To VL View debug1: vl: Prose debug2: view: Prose 7.1:2.987982988357544 7.2:0.0 7.3:0.0 7.4:1.4749689102172852 7.5:0.0 7.6:0.0 7.10:0.0 Action Chains: chain (VL View) finished in: 0:00:01.695132 Action Chains: Is db modified by event: True Action Chains: event (VL Tab Changed) finished in: 0:00:01.710650 Action Chains: Signal vl_tab_changed emitted Action Chains: Starting event: VL Tab Changed Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: VL View Action Chains: VL View: starting action No. 1: Switch To VL View debug1: vl: Fanfiction debug2: view: Fanfic 7.1:2.9287922382354736 7.2:0.0 7.3:0.0 7.4:2.2907092571258545 7.5:0.012963533401489258 7.6:0.0 7.10:0.0 Action Chains: chain (VL View) finished in: 0:00:02.619679 Action Chains: Is db modified by event: True Action Chains: event (VL Tab Changed) finished in: 0:00:02.641620 Action Chains: Signal vl_tab_changed emitted Action Chains: Starting event: VL Tab Changed Action chains: formulas: running on_templates_update() calling method (init_cache) of obj (selection_count) Action chains: formulas: running on_templates_update() calling method (flush_cache) of obj (selection_count) Action Chains: Starting chain: VL View Action Chains: VL View: starting action No. 1: Switch To VL ViewTraceback (most recent call last): File "calibre\gui2\ui.py", line 135, in __init__ File "calibre\gui2\ui.py", line 153, in init_iaction File "calibre_plugins.fanficfare_plugin.__init__", line 121, in load_actual_plugin File "calibre\customize\__init__.py", line 624, in load_actual_plugin File "importlib\__init__.py", line 127, in import_module File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "calibre\customize\zipplugin.py", line 191, in exec_module File "calibre_plugins.fanficfare_plugin.fff_plugin", line 80, in <module> File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 655, in _load_unlocked File "<frozen importlib._bootstrap>", line 618, in _load_backward_compatible File "zipimport.py", line 259, in load_module File "C:\Users\jnikk\AppData\Roaming\calibre\plugins\FanFicFare.zip\fanficfare\adapters\__init__.py", line 132, in <module> File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 971, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 914, in _find_spec File "<frozen importlib._bootstrap_external>", line 1342, in find_spec File "<frozen importlib._bootstrap_external>", line 1316, in _get_spec File "<frozen importlib._bootstrap_external>", line 1297, in _legacy_get_spec File "<frozen importlib._bootstrap>", line 414, in spec_from_loader File "<frozen importlib._bootstrap_external>", line 649, in spec_from_file_location File "zipimport.py", line 191, in get_filename File "zipimport.py", line 709, in _get_module_code File "zipimport.py", line 536, in _get_data PermissionError: [Errno 13] Permission denied: 'C:\\Users\\jnikk\\AppData\\Roaming\\calibre\\plugins\\FanFicFare.zip' debug1: vl: Prose debug2: view: Prose 7.1:2.425004005432129 7.2:0.0 7.3:0.0 7.4:2.5235352516174316 7.5:0.0 7.6:0.0 7.10:0.0 Action Chains: chain (VL View) finished in: 0:00:02.805604 Action Chains: Is db modified by event: True Action Chains: event (VL Tab Changed) finished in: 0:00:02.821227 Action Chains: Signal vl_tab_changed emitted |
||
03-05-2022, 04:54 PM | #24 | |
null operator (he/him)
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
If you have one of the SQLite utilities you could try poking the library database with it in Safe Mode - I use this one ==>> DB Browser for SQLite BR Last edited by BetterRed; 03-05-2022 at 05:00 PM. |
|
03-05-2022, 05:07 PM | #25 | |
Plugin Developer
Posts: 6,328
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Quote:
When doing VL changes, it looks like Action Chains is calling VM's apply_column_and_sort() instead of switch_view(), which I would have expected. For one thing, it means that the "7.1" time can't be trusted--VM is resetting the time at the start of switch_view(). What you see there for 7.1 includes all the wall-clock time passed since the last interaction. You may be right, but you can't trust this output to tell you. (Presumably Action Chains is also reading the VM config data needed to call apply_column_and_sort()? I don't know what it does...) I'm not usually involved in debugging whole libraries. Is it appropriate to ask for a zipped copy of the library to look at? If it's not too private or too copyrighted, that is. |
|
03-05-2022, 05:08 PM | #26 | |
Custom User Title
Posts: 8,639
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
|
|
03-06-2022, 01:45 AM | #27 | ||
Connoisseur
Posts: 51
Karma: 198
Join Date: Feb 2022
Device: Kindle PW5/11th Gen
|
Quote:
Quote:
So this is my Action Chains script... I just copy/pasted from this post. Is there something I should change in that, to make it call switch_view() instead? PHP Code:
|
||
03-06-2022, 03:09 AM | #28 |
Custom User Title
Posts: 8,639
Karma: 61234567
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Just the duplicated test library should work for these purposes; I've done it before. You don't need to send any of the files either, just the metadata.db.
|
03-06-2022, 03:21 AM | #29 | |
null operator (he/him)
Posts: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Secure a copy of it with your file manager (with calibre closed), then delete all the Author and Book folders so that it looks something this: ** Then start calibre and access that library (you won't see any covers) and do whatever to see if it's still laggy - assuming it is you could zip that library, upload it somewhere, and PM the link to Jim. BR ** you might not have the …backup.json and …restore.db files, that's OK. Last edited by BetterRed; 03-06-2022 at 03:25 AM. |
|
03-06-2022, 04:03 PM | #30 | |
Connoisseur
Posts: 51
Karma: 198
Join Date: Feb 2022
Device: Kindle PW5/11th Gen
|
Quote:
Thank you all again for the help. I really appreciate it. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extremely slow in long files | arspr | Editor | 11 | 06-26-2014 06:22 AM |
[Old Thread] Why is Calibre so slow sending ebooks in emails? | rfog | Calibre | 10 | 05-17-2013 01:42 PM |
This long thread title is intended to reflect my thought's incredible complexity. | Prestidigitweeze | Lounge | 11 | 04-20-2012 06:28 AM |
[Old thread] Calibre really slow | spaze | Calibre | 15 | 03-24-2011 04:04 AM |
[Old Thread] Slow to 'get list of books on device' for Kindle DX | tklaus | Devices | 4 | 03-10-2011 12:11 PM |