Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Viewer

Notices

Reply
 
Thread Tools Search this Thread
Old 04-30-2021, 05:36 PM   #31
Geremia
Addict
Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!
 
Posts: 238
Karma: 100000
Join Date: Oct 2012
Device: Calibre
I've grepped the relavant lines from what ebook-viewer does:
Code:
Created context:
  effective context type: WEB_PAGE
Created context:
  effective context type: UNSPECIFIED
Num tracked contexts: 1
Created context:
  effective context type: WEB_PAGE
Created context:
  effective context type: UNSPECIFIED
Num tracked contexts: 1
Created context:
  effective context type: WEB_PAGE
Created context:
  effective context type: UNSPECIFIED
Num tracked contexts: 2
Created context:
  effective context type: WEB_PAGE
Created context:
  effective context type: UNSPECIFIED
Num tracked contexts: 2
Created context:
  effective context type: WEB_PAGE
Created context:
  effective context type: UNSPECIFIED
Num tracked contexts: 3
Created context:
  effective context type: WEB_PAGE
Created context:
  effective context type: UNSPECIFIED
Num tracked contexts: 4
Created context:
  effective context type: WEB_PAGE
Created context:
  effective context type: UNSPECIFIED
Num tracked contexts: 5
Created context:
  effective context type: WEB_PAGE
Created context:
  effective context type: UNSPECIFIED
Num tracked contexts: 6
Num tracked contexts: 5
Num tracked contexts: 4
Created context:
  effective context type: WEB_PAGE
Created context:
  effective context type: UNSPECIFIED
Num tracked contexts: 5
Destroyed context for extension
Destroyed context for extension
Destroyed context for extension
Destroyed context for extension
Created context:
  effective context type: WEB_PAGE
Created context:
  effective context type: UNSPECIFIED
Num tracked contexts: 6
Compared to what quicknanobrowser does:
Code:
Created context:
  effective context type: WEBUI
Created context:
  effective context type: UNSPECIFIED
Num tracked contexts: 1
Why does ebook-viewer create contexts, destroy them, create them again, etc.? What I've shown above all occurs before the ebook finally appears.

ebook-viewer has several "Destroyed context for extension"s; quicknanobrowser doesn't have those. Is there a memory leak going on?

Last edited by Geremia; 04-30-2021 at 05:42 PM.
Geremia is offline   Reply With Quote
Old 04-30-2021, 11:28 PM   #32
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,526
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by Geremia View Post
Once ebook-viewer loads an EPUB, it's not slow at all; I still wonder why it takes so long to load. It loads just as slowly for large as for small EPUBs. Opening another EPUB from within ebook-viewer takes a long time, too.
Again, because the issue is the time WebEngine takes to INITIALIZE. It has nothing to do with calibre code. You need to figure out why WebEngine is slow on your machine, endlessly harping on about contexts is not going to change anything. And, in Chrome, a context is created per frame such as for iframes. The viewer uses several iframes. Creating an iframe is not an operation that takes more than a few milliseconds, unless something is severely broken.
kovidgoyal is offline   Reply With Quote
Advert
Old 04-30-2021, 11:53 PM   #33
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,526
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There you go with the gory details about script contexts: https://wiki.qt.io/QtWebEngine/ScriptsAndExtensions

The viewer's code is precisely an injected script, that is run on every iframe, hence the various messages.
kovidgoyal is offline   Reply With Quote
Old 05-01-2021, 01:24 AM   #34
Geremia
Addict
Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!
 
Posts: 238
Karma: 100000
Join Date: Oct 2012
Device: Calibre
Quote:
Originally Posted by kovidgoyal View Post
The viewer's code is precisely an injected script
Calibre's scripts are injected after "bridge ready"?
Geremia is offline   Reply With Quote
Old 05-01-2021, 02:10 AM   #35
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,526
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by Geremia View Post
Calibre's scripts are injected after "bridge ready"?
yes, the sub frames are created only after bridge ready. The main frame gets the script injected first, that script runs and does bridge ready, after which sub frames are created. And only after they are created, is the script injected into them, so that happens well after bridge ready.

That said, there was one optimisation to be had post bridge ready, so it wont help you, but: https://github.com/kovidgoyal/calibr...3589db2a971296
kovidgoyal is offline   Reply With Quote
Advert
Old 05-01-2021, 10:21 AM   #36
Rida
Member
Rida began at the beginning.
 
Rida's Avatar
 
Posts: 19
Karma: 10
Join Date: Apr 2020
Device: Kobo Forma
Question

Quote:
Originally Posted by thiago.eec View Post
1) Type CMD on windows search bar and press enter.
2) To open the Viewer without a book, just type: calibre-debug -w
3) To open a book, type: calibre-debug -w "path/to/the/book/book.epub"

Theses commands will print the timings on your console window (CMD).
Thank you for that.

I think my books are a bit slow to load, so I did those things.

2) Produces this:

Turning on automatic hidpi scaling
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 106.38743455497382 x 106.32558139534883
Using calibre Qt style: True
[5.531] bridge ready

3) for a book I've never opened before (0.3MB) produces this:

Turning on automatic hidpi scaling
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 106.38743455497382 x 106.32558139534883
Using calibre Qt style: True
[0.000] Load of book started
[2.984] bridge ready
[8.500] prepared emitted
[8.563] webview loading requested
[9.375] loading finished

3) for the same book that I've already opened (I opened and then closed it again in calibre before I tried it via the command prompt) produces this:

Turning on automatic hidpi scaling
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 106.38743455497382 x 106.32558139534883
Using calibre Qt style: True
[0.000] Load of book started
[0.078] prepared emitted
[0.235] webview loading requested
[1.266] bridge ready
[3.219] loading finished

I don't know if that's unusually slow or not.

If it is, can anyone suggest anything I can do to improve things, please?

As I said, I'm on Windows 10.

Thanks.
Rida is offline   Reply With Quote
Old 05-01-2021, 03:56 PM   #37
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,370
Karma: 136466962
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
If you are on a laptop with dual display chipsets, switch to the other display chipset when Calibre runs and see how you get on.
JSWolf is offline   Reply With Quote
Old 05-01-2021, 04:45 PM   #38
Rida
Member
Rida began at the beginning.
 
Rida's Avatar
 
Posts: 19
Karma: 10
Join Date: Apr 2020
Device: Kobo Forma
Quote:
Originally Posted by JSWolf View Post
If you are on a laptop with dual display chipsets, switch to the other display chipset when Calibre runs and see how you get on.
Thanks. I am on a laptop but I don't have another monitor.

I don't know what a dual display chipset is, and an (admittedly brief) Google search didn't enlighten me at all.

Are the timings I posted abnormally slow?
Rida is offline   Reply With Quote
Old 05-01-2021, 05:57 PM   #39
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Rida View Post
Thanks. I am on a laptop but I don't have another monitor.

I don't know what a dual display chipset is, and an (admittedly brief) Google search didn't enlighten me at all.

Are the timings I posted abnormally slow?
In my laptop, there are two display drivers. One is for the on-board Intel UHD chipset and the other is for an Nvidia chipset. Normally, the Intel chipset is used for the built-in monitor while external monitors will switch to use of the Nvidia chipset due to my external monitor display resolution however running a 3D graphics program will force use the Nvidia chipset unless I play with the settings in the Nvidia control panel.

However if I disable the Nvidia driver, the Intel driver will be used for external monitors. Alternatively, if I disable the Intel driver, the NVidia driver will be used for the built-in monitor. The price for that is the NVidia chipset seems to think power is free.

You might want to check your laptop manufacturer for what video hardware is installed.
DNSB is offline   Reply With Quote
Old 05-02-2021, 02:05 AM   #40
Rida
Member
Rida began at the beginning.
 
Rida's Avatar
 
Posts: 19
Karma: 10
Join Date: Apr 2020
Device: Kobo Forma
Thanks again. I'm way out of my depth.

I have two entries under "Display adaptors" in Device Manager:

AMD Radeon R9 M200X Series
Intel(R) HD Graphics Family

I don't know which one my laptop uses.

A while back, after a Window update I assume, I got a Radeon Software icon in my system tray. I've never clicked on it until now. When I do, it looks like this.

Click image for larger version

Name:	xXuiwY6.png
Views:	299
Size:	112.7 KB
ID:	186880

The best I could do to check my laptop manufacturer for what video hardware is installed was to go to the dell site: https://www.dell.com/support/home/en...-17r-5737/docs

The manual for my 17r-5737 - https://downloads.dell.com/manuals/a...uide_en-us.pdf - doesn't seem to be much use for what we're talking about.

I don't think I should waste your time much more. Perhaps my laptop is just old and decrepit?

Could I try disabling either "AMD Radeon R9 M200X Series" or "Intel(R) HD Graphics Family"? As I say, I don't know which one is being used at the moment.

Last edited by BetterRed; 05-02-2021 at 07:10 PM. Reason: Oversize image - thumbnailed
Rida is offline   Reply With Quote
Old 05-02-2021, 02:44 AM   #41
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Rida View Post
Thanks again. I'm way out of my depth.

I have two entries under "Display adaptors" in Device Manager:

AMD Radeon R9 M200X Series
Intel(R) HD Graphics Family

I don't know which one my laptop uses.
Much like my laptop, it can use either or both depending on how your system in configured. If you right click on a blank spot on your desktop, select Display Properties and then Advanced display settings, you can see what driver your display is connected to. I've attached some images from my laptop as an example.

Quote:
Originally Posted by Rida View Post
Could I try disabling either "AMD Radeon R9 M200X Series" or "Intel(R) HD Graphics Family"? As I say, I don't know which one is being used at the moment.
If you are using the laptop display, you should be able to disable one of the drivers to force the other to be used. Or this may be an option in the Radeon control panel if it is one that is customized for your laptop. I know on my laptop, I need to do any display driver updates from the Lenovo site unless I want to have "interesting" results and the customized Nvidia control panel allows me some control over which video chipset is active.
Attached Thumbnails
Click image for larger version

Name:	Advanced display Settings.png
Views:	336
Size:	31.9 KB
ID:	186874   Click image for larger version

Name:	Nvidia Control Panel.png
Views:	340
Size:	73.7 KB
ID:	186875  
DNSB is offline   Reply With Quote
Old 05-02-2021, 04:25 AM   #42
Rida
Member
Rida began at the beginning.
 
Rida's Avatar
 
Posts: 19
Karma: 10
Join Date: Apr 2020
Device: Kobo Forma
Quote:
Originally Posted by DNSB View Post
If you right click on a blank spot on your desktop, select Display Properties and then Advanced display settings, you can see what driver your display is connected to.
Thanks, David.
I've attached my Advanced display settings.

Quote:
Originally Posted by DNSB View Post
Much like my laptop, it can use either or both depending on how your system in configured.

...

If you are using the laptop display, you should be able to disable one of the drivers to force the other to be used. Or this may be an option in the Radeon control panel if it is one that is customized for your laptop.
I notice you, like me, are using the Intel Graphics thing. Do you not use the Nvidia one? And if you don't, are you still recommending that I do (well, Radeon in my case)?

Quote:
Originally Posted by DNSB View Post
I know on my laptop, I need to do any display driver updates from the Lenovo site unless I want to have "interesting" results and the customized Nvidia control panel allows me some control over which video chipset is active.
Is updating the drivers a separate thing? I think you're just recommending I update my drivers in case that's the problem?

I'll try to choose the Radeon one now anyway but in case you're about now, hopefully you could reply to this first and then we can move forward in stages. [I'll check for replies much more frequently than I just did.]

Much appreciated; calibre does seem pretty slow to load books and also to close the window after I've edited metadata.

EDIT: Before I do anything else, I went into the Intel 3D settings (beacuse you did in your Nvidia settings - I had no idea what 3D settings were for or that they would have anything to do with calibre). I saw that General Settings was set to Balanced, so I changed it to Quality. I wonder if this might help in itself. (I don't have battery in my laptop because it broke so I don't care about power saving really.). I've attached that screenshot too.
Attached Thumbnails
Click image for larger version

Name:	advanced display settings1.png
Views:	309
Size:	34.8 KB
ID:	186876   Click image for larger version

Name:	Intel 3D settings1.png
Views:	313
Size:	710.8 KB
ID:	186877  

Last edited by Rida; 05-02-2021 at 04:36 AM.
Rida is offline   Reply With Quote
Old 05-02-2021, 05:02 AM   #43
Rida
Member
Rida began at the beginning.
 
Rida's Avatar
 
Posts: 19
Karma: 10
Join Date: Apr 2020
Device: Kobo Forma
Quote:
Originally Posted by DNSB View Post
If you are using the laptop display, you should be able to disable one of the drivers to force the other to be used. Or this may be an option in the Radeon control panel if it is one that is customized for your laptop.
I can't for the life of me see how to do this in the Radeon Software panel.

It looks like I could disable the Intel device in Control Panel. See attached. Is this how to do it?
Rida is offline   Reply With Quote
Old 05-02-2021, 09:30 PM   #44
Geremia
Addict
Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!Geremia rocks like Gibraltar!
 
Posts: 238
Karma: 100000
Join Date: Oct 2012
Device: Calibre
I notice that when ebook-reader is open, the graphics (such as switching virtual desktops) really slows down. I don't have these issues with any other apps.

Also, ebook-viewer run stand-alone from the commandline is much faster at loading books than ebook-viewer launched from within Calibre by hitting "v" key. "Loading book, please wait" takes less than a few seconds, compared to several seconds.

Last edited by Geremia; 05-02-2021 at 09:36 PM.
Geremia is offline   Reply With Quote
Old 05-02-2021, 10:33 PM   #45
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 40,475
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Rida View Post
Thanks, David.
I've attached my Advanced display settings.


I notice you, like me, are using the Intel Graphics thing. Do you not use the Nvidia one? And if you don't, are you still recommending that I do (well, Radeon in my case)?
The Nvidia driver is more capable than the Intel driver however it is also uses a lot more power. I only use the Nvidia chipset when I need the performance.


Quote:
Originally Posted by Rida View Post
Is updating the drivers a separate thing? I think you're just recommending I update my drivers in case that's the problem?
Lenovo supplies the video drivers as a package. This allows testing them together and making sure the driver switching works. I suspect Dell does the same so looking into a video driver update is definitely work doing.

Quote:
Originally Posted by Rida View Post
I'll try to choose the Radeon one now anyway but in case you're about now, hopefully you could reply to this first and then we can move forward in stages. [I'll check for replies much more frequently than I just did.]

Much appreciated; calibre does seem pretty slow to load books and also to close the window after I've edited metadata.

EDIT: Before I do anything else, I went into the Intel 3D settings (beacuse you did in your Nvidia settings - I had no idea what 3D settings were for or that they would have anything to do with calibre). I saw that General Settings was set to Balanced, so I changed it to Quality. I wonder if this might help in itself. (I don't have battery in my laptop because it broke so I don't care about power saving really.). I've attached that screenshot too.
At one point in time, if i forced the Nvidia chipset in the 3D settings, it also set the Nvidia chipset as the default for my standard 2D Windows desktop. I reported this as a bug and the bug was reported as having been fixed but I've never tested that. One of my co-workers had the same issue on his HP laptop which she aggravated by updating the two video drivers separately.
DNSB is offline   Reply With Quote
Reply

Tags
calibre4.1, shortcuts, slider, viewer


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
One specific epub dead slow in viewer? Claghorn Calibre 2 09-03-2017 08:04 AM
Read-Only copy of the viewer NatLibAus Development 3 12-12-2016 12:56 AM
Savoring a Slow Read taosaur General Discussions 60 03-03-2014 11:20 PM
Barnes adn Noble App on iPad Dulin's Books News 4 03-11-2010 09:58 PM
too slow to read pdfs with many pages? alanine iRex 4 10-12-2007 07:41 PM


All times are GMT -4. The time now is 07:18 PM.


MobileRead.com is a privately owned, operated and funded community.