Unexpected delay between OnLoadingStateChange and OnLoadStar

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Unexpected delay between OnLoadingStateChange and OnLoadStar

Postby callum » Fri Jan 19, 2018 11:40 am

I am trying to diagnose why, when navigating to some URLs in my app, there a long delay (~5 seconds) between my CefLoadHandler::OnLoadingStateChange(...) and CefLoadHandler::OnLoadStart(..) methods being called.

Best guess so far is that I'm not calling CefDoMessageLoopWork() often enough - certainly a possibility however, when the page loads, it functions as expected.

I am using the latest 64 bit CEF on Windows.

Anyone else encounter this and suggest what might be going on ?
callum
Expert
 
Posts: 326
Joined: Mon Feb 23, 2015 6:19 pm

Re: Unexpected delay between OnLoadingStateChange and OnLoad

Postby Czarek » Fri Jan 19, 2018 2:58 pm

What CEF version? Which method gets called first? Is the page loading 5 seconds?
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Unexpected delay between OnLoadingStateChange and OnLoad

Postby callum » Fri Jan 19, 2018 3:08 pm

> latest 64 bit CEF on Windows

cef_binary_3.3239.1723.g071d1c1_windows64

CefLoadHandler::OnLoadingStateChange(..) gets called first.

~5 seconds elapse

CefLoadHandler::OnLoadStart(...) gets called

PAge loads instantly in Chrome built from same version of Chromuim
callum
Expert
 
Posts: 326
Joined: Mon Feb 23, 2015 6:19 pm

Re: Unexpected delay between OnLoadingStateChange and OnLoad

Postby HarmlessDave » Fri Jan 19, 2018 4:11 pm

Does it only happen on the very first page when your CEF app first starts up? CEF does a bunch of one-time initialization at startup that can take from 1-2 up to 10+ seconds on a slow PC. Chrome seems to cheat by doing some of that before they display a window.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Unexpected delay between OnLoadingStateChange and OnLoad

Postby callum » Fri Jan 19, 2018 4:18 pm

The "App" is starting up although it's not really an app but rather a DLL that is loaded for each app feature that needs an embedded browser.

Replacing the startup URL with something else like Google home page still takes about the same amount of time.

I'll try to break it out into it's own CEF app and see if it repros - will be easier to share/diagnose like that.
callum
Expert
 
Posts: 326
Joined: Mon Feb 23, 2015 6:19 pm

Re: Unexpected delay between OnLoadingStateChange and OnLoad

Postby magreenblatt » Thu Feb 01, 2018 10:00 pm

Does the problem reproduce in the cefclient sample application? It could be a proxy resolution delay as described at https://bitbucket.org/chromiumembedded/ ... resolution
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Unexpected delay between OnLoadingStateChange and OnLoad

Postby callum » Thu Feb 01, 2018 10:09 pm

No, the same page seems to load quickly in cefclient. I'm not using any proxies - or does that resolution step happen in any case?
callum
Expert
 
Posts: 326
Joined: Mon Feb 23, 2015 6:19 pm

Re: Unexpected delay between OnLoadingStateChange and OnLoad

Postby magreenblatt » Thu Feb 01, 2018 10:55 pm

callum wrote:No, the same page seems to load quickly in cefclient. I'm not using any proxies - or does that resolution step happen in any case?

You can try passing `--no-proxy-server` command-line flag just to make sure that's not the issue.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Unexpected delay between OnLoadingStateChange and OnLoad

Postby callum » Fri Feb 02, 2018 4:37 pm

Yep, made no difference.
callum
Expert
 
Posts: 326
Joined: Mon Feb 23, 2015 6:19 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 60 guests