08-25-2022, 09:30 PM | #1 |
Guru
Posts: 751
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Viewer Occasionally Takes a Long Time to Open EPUB
Occasionally, upon first opening an epub in Calibre's viewer, it takes a long time to open (several minutes as opposed to a couple of seconds). Usually, this is just after I've used Calibre's editor to strip out all the publishers' CSS and replace it with my standard set. Once the viewer opens, there's no problem and the delay doesn't repeat itself when I view the book again (even if I have the editor strip out the viewer's files). This doesn't happen with the vast majority of my books. There's nothing special about the books where it happens: the number of chapters (files) is normal (say about 25) and the chapter (file) size is nothing special. AFAICS, there's nothing left in the HTML (or in my standard CSS) that could be causing this kind of slowdown.
This is on Windows 11 Pro x64 (fully updated) with the latest Calibre (6.3). Nothing else is running. Here's a screenshot of Windows Task Manager for the Calibre tasks while it's happening (it's at the top of the list so is what's taking the most resources (even though it's practically nothing). Sorry I can't figure out how to reproduce it reliably. But, I thought I'd report it in case others run across it. Maybe it's a QT thing? EDIT: I've tried getting this image down to the forum's recommended size, but it becomes unreadable. it's a pretty small image, so maybe it's ok. If not, let me know and I'll put the teeny-tiny one in. Moderator Notice Changed to attachment. Paperclip on Advanced Menu EDIT 2: When I checked the task manager, I didn't even see Windows Defender churning away. So, I don't think the antivirus is the issue (if it were, I'd have thought it would be at the top of the task list). But, next time it happens, I'll take a look for what Defender is doing in particular. Last edited by theducks; 08-25-2022 at 10:46 PM. |
08-25-2022, 11:53 PM | #2 |
null operator (he/him)
Posts: 20,999
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
The viewer converts the format file being viewed to "Kovid Goyal's universal format", and it does that in the calibre cache directory. You can relocate it via the CALIBRE_CACHE_DIRECTORY Environment variable. Might be an idea to monitor what's going on within it.
What happens if you make a minor change to the epub content (i.e. the text , not the markup) - that should trigger the 'first read' process. I doubt it will be anything to do with Defender, too many people use it without any troubles. BR |
Advert | |
|
08-26-2022, 01:03 AM | #3 |
Guru
Posts: 751
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Once the viewer comes up for one of those long-load-time books, subsequent loads are normal (well, I assume they're normal -- I haven't run across one of these instances that happens more than once on any given book). Editing the book doesn't make a difference.
Regarding the cache directory, is it supposed to be set? There doesn't appear to be any Calibre environment variables set anywhere. ...\AppData\Roaming\calibre\caches is empty and I don't see a cache directory anywhere under ...\Program Files\Calibre2. Of course, even if there were problems there, I'm on a NVME only system, so loading times shouldn't be in the multi-minute range for a ~ 1MB epub. |
08-26-2022, 02:38 AM | #4 |
null operator (he/him)
Posts: 20,999
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
The Env Vars are used to override the 'internal' defaults, so they are not normally set.
I think the default cache directory location is within the configuration directory - so, in Windows that would be c:\users\<username>\appdata\roaming\calibre\cache. I've used the Env Vars to put the configuration on my HDD Data drive alongside my libraries, and the cache is on an SSD. Start utilities have been know to interfere with calibre's functioning - e.g. things that purport to clean up temporary files dynamically. |
08-26-2022, 02:39 AM | #5 |
creator of calibre
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The first time a book is opened it can be slow as the viewer has to preprocess it to make it suitable for display. Same thing happens if the book is edited since the preprocessing has to happen again. Depending on the size/complexity of the epub this can take a little while.
|
Advert | |
|
08-26-2022, 10:46 AM | #6 | |
Guru
Posts: 751
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Quote:
But, now that you mention it, I'm not sure if the viewer is taking a long time at the "preparing book for first read" point or if it's on one of the "loading book" points. I'll try to pay more attention the next time it happens. |
|
08-26-2022, 11:35 PM | #7 |
Guru
Posts: 751
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Just happened again with another book. It's taking all that time at the "preparing book for first read" task. According to Task Manager, nothing much is running (the Calibre stuff is taking the most resources (though they're a miniscule amount)). Nothing fails, so there's nothing in Windows' Event Viewer. Closing the viewer and immediately re-opening takes the normal couple of seconds. Closing the viewer again, editing the epub, removing the viewer bookmarks file, saving and re-opening the viewer takes the normal couple of seconds.
I'm pretty much stumped for what could be causing this and how to track it down. Perhaps it's a Windows 11 issue. I'll stick my system information here and maybe over time other people will run into the issue and can use it as a comparison: Code:
Computer: GIGABYTE B550 VISION D-P CPU: AMD Ryzen 5 5600X (Vermeer, VMR-B0) 3700 MHz (37.00x100.0) @ 3555 MHz (36.00x98.8) Motherboard: GIGABYTE B550 VISION D-P BIOS: F15d, 07/20/2022 Chipset: AMD B550 (Promontory PROM19 C) Memory: 16384 MBytes @ 1580 MHz, 14-14-14-34 - 8192 MB PC25600 DDR4 SDRAM - G.Skill F4-3200C14-8GFX - 8192 MB PC25600 DDR4 SDRAM - G.Skill F4-3200C14-8GFX Graphics: AMD Radeon RX 6800 XT AMD Radeon RX 6800 XT, 16384 MB GDDR6 SDRAM Drive: KINGSTON SKC3000D2048G, 2000.4 GB, NVMe Sound: ATI/AMD Navi2x - High Definition Audio Controller Sound: AMD Family 17h/19h - HD Audio Controller Network: RealTek Semiconductor RTL8125 Gaming 2.5GbE Family Ethernet Controller Network: Intel Wi-Fi 6 AX200 160MHz Network: Intel I225-V Ethernet Controller OS: Microsoft Windows 11 Professional (x64) Build 22000.856 |
08-27-2022, 02:51 AM | #8 |
creator of calibre
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Preparing book for read uses worker processes under the hood. With these kind of mysterious slowdowns on windows, I usually suspect the antivirus. It's likely subjecting the worker process to blockage/slowdowns occassionally.
|
08-27-2022, 06:15 AM | #9 |
Resident Curmudgeon
Posts: 76,433
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
08-27-2022, 09:48 AM | #10 |
Guru
Posts: 751
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
In that last case, it was Ben Aaronovitch's "Lies Sleeping" (Rivers of London #7). But, again, there's nothing odd in that book (or any of the others where it's happened) that I can find. All it's CSS has been replaced with a subset of my standard set, I run the Calibre Editor's "Check Books" and the Epubcheck plugin on it without problem, and the delay happens only once. Since I can't find any common denominator for the times this happens, I tend to agree with Kovid and think it's some issue with Windows. But, what it is or why it's happening, I don't know.
EDIT: I also run the editor's "Remove Unused CSS Rules," "Fix HTML," and "Beautify All Files" on the book. Last edited by enuddleyarbl; 08-27-2022 at 10:03 AM. |
08-27-2022, 12:49 PM | #11 | |
Resident Curmudgeon
Posts: 76,433
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
I'm running Windows 11. Last edited by JSWolf; 08-27-2022 at 12:51 PM. |
|
08-27-2022, 01:41 PM | #12 | |
Guru
Posts: 751
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Quote:
EDIT: In case you're wondering, here's the CSS I'm using in the book (the only things that aren't normal for me are the last two "table" type classes): Code:
@page { margin-top: 0; margin-left: 0; margin-right: 0; margin-bottom: 0; } body, html { /* Basic Styling for HTML and BODY Sections of a File */ border-width: 0; height: 100%; margin: 0; orphans: 1; padding: 0; widows: 1; } h1, h2 { /* Basic Chapter Heading Stlying */ margin-top: 0.7em; margin-bottom: 0.7em; page-break-before: always; page-break-after: avoid; text-align: center; } h1 + p, h2 + p, hr + p, .note + p, .placard + p, .song + p { /* Non-indented Paragraphs Styling (for paragraphs that follow something and shouldn't be indented) */ text-indent: 0; } h1 + p::first-letter, h2 + p::first-letter, hr + p::first-letter { /* First-Letter Styling (for the first letter following certain things (IOW, dropcaps)) */ font-weight: bold; } hr { /* Thematic break to use 3 asterisks between parts of story */ margin-top: 0.9em; margin-bottom: 0.9em; border: none; } hr::before { content: "***"; display: block; text-align: center; } p { /* Basic paragraph styling */ display: block; margin-top: 0; margin-bottom: 1; text-indent: 1.2em; } /* */ /* This whole section is styling for specific page types of a book */ /* */ div.aboutauthorpage p { /* About the Author Page Styling */ margin-left: 5%; margin-right: 5%; } div.titlepage p { text-align: center; text-indent: 0; } div.acknowledgmentspage p { /* Acknowledgments Page Styling */ margin-left: 5%; margin-right: 5%; text-align: center; text-indent: 0; } div.alsobypage p { /* Also By Page Styling */ font-size: small; margin-left: 5%; margin-right: 5%; text-align: center; text-indent: 0; } div.copyrightpage p { /* Copyright Page Styling */ font-size: small; margin-bottom: 0.5em; text-align: center; text-indent: 0; } div.dedicationpage p { /* Dedication Page Styling */ font-size: 90%; font-style: italic; margin-left: 5%; margin-right: 5%; text-align: center; text-indent: 0; } div.epigraphpage p.signature, .signature { margin-bottom: 0.5em; margin-top: 0.5em; text-align: right; } div.epigraphpage p { /* Epigraph Page Styling */ font-size: small; margin-left: 15%; margin-right: 15%; text-indent: 0; } /* */ /* This is a section for types of chunks on a page */ /* */ div.note { /* Letter Styling */ display: block; font-size: 0.88em; margin-left: 2em; margin-right: 2em; text-align: left; } div.note p { margin-bottom: 1em; margin-top: 1em; text-indent: 0; } div.song { /* Song Styling */ display: block; font-size: 0.88em; font-style: italic; font-weight: bold; margin-left: 2em; margin-right: 2em; } div.song p { padding-left: 3em; text-indent: -3em; text-align: left; } /* */ /* A styling section for things that apply everywhere */ /* */ .placard { /* Styling for a placard or headline */ font-size: 0.88em; font-weight: bold; margin-bottom: 2em; margin-top: 2em; text-align: center; text-indent: 0; } .smallcaps { /* Smallcaps styling (text should be typed normally and will be smallcapped) */ font-variant: small-caps; } table#table001 { table-layout: fixed; width: 100%; border-collapse: separate; border-spacing: 5px; border: 1px black solid; } table#table001 td { width: 50%; border: 0; padding: 2px; } Last edited by enuddleyarbl; 08-27-2022 at 01:44 PM. |
|
08-27-2022, 05:47 PM | #13 | |
Resident Curmudgeon
Posts: 76,433
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
12-10-2022, 07:06 PM | #14 |
Guru
Posts: 751
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
|
01-10-2023, 09:10 PM | #15 |
Guru
Posts: 751
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
I guess I'd better update this. No, turning off gpu hardware acceleration for QTWebEngine (the above link) didn't work. The only thing that worked was reverting my AMD graphics driver (Adrenalin) all the way back to Adrenalin 22.5.1.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Highlight takes very long time on phone/ tablets via content sever | WHY | Viewer | 7 | 05-23-2021 01:30 PM |
Calibre takes a long time to open | K8HW | Calibre | 30 | 02-27-2018 09:09 AM |
Loading flow... takes too long every time. | bobgus | Conversion | 4 | 03-12-2013 10:10 PM |
Get list on device takes a long time | sinusLog | Devices | 6 | 10-17-2011 02:56 AM |
Get Device Infomation takes a LONG time? | jotekman | Calibre | 4 | 11-21-2009 12:41 PM |