Implementing V8 snapshot feature in CEF

Do not post support requests, bug reports or feature requests. Discuss CEF here. Non-CEF related discussion goes in General Discussion!

Implementing V8 snapshot feature in CEF

Postby Panneerselvam » Fri Apr 28, 2017 1:35 am

Hi,
I have a CEF based app running for sometime. Now, I would like to add V8 snapshot functionality in the app. As part of the implementation, i need to get access to following v8 functions:
v8::CreateSnapshotDataBlob
v8::ScriptCompiler
Can you please let me know, how to access these functions from CEF environment?
Thanks!!!
Panneerselvam
Techie
 
Posts: 15
Joined: Thu May 29, 2014 3:36 am

Re: Implementing V8 snapshot feature in CEF

Postby Czarek » Sat Apr 29, 2017 12:13 pm

CEF doesn't expose such functionality. You would need to hack CEF sources.
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: Implementing V8 snapshot feature in CEF

Postby Panneerselvam » Tue May 02, 2017 5:26 am

Thanks, Is there a plan to add in the future? Are you aware of any existing PR for this feature?
Panneerselvam
Techie
 
Posts: 15
Joined: Thu May 29, 2014 3:36 am

Re: Implementing V8 snapshot feature in CEF

Postby Czarek » Tue May 02, 2017 8:11 am

Not aware of. Search the tracker to be sure.
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: Implementing V8 snapshot feature in CEF

Postby magreenblatt » Tue May 02, 2017 11:09 am

Presumably you're interested in V8 snapshots because you read this article about Electron: http://blog.atom.io/2017/04/18/improvin ... -time.html

As noted in that article it is difficult to use V8 snapshot functionality correctly (you can't access the DOM) and any potential benefits depend a lot on the structure of the HTML/JS/CSS involved. For example, in Electron's case most of their performance gain came from improving their JavaScript "require" implementation and from optimizing CSS files. Those are both things that could be accomplished without the use of V8 snapshots.

Since usage is difficult and any potential performance benefits can likely be achieved by other means there are no plans to expose V8 snapshot functionality in CEF at this time.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Implementing V8 snapshot feature in CEF

Postby Panneerselvam » Thu May 04, 2017 10:25 am

Thanks, I am looking for achieving the functionality similar to http://docs.nwjs.io/en/latest/For%20Use ... ce%20Code/
I feel it serves for source code protection and faster loading time.
I think, chrome is taking bigger steps towards wasm; snapshot eventually lead to wasm.
Please correct me if i am wrong.
Thanks again!!
Panneerselvam
Techie
 
Posts: 15
Joined: Thu May 29, 2014 3:36 am

Re: Implementing V8 snapshot feature in CEF

Postby magreenblatt » Thu May 04, 2017 11:39 am

The nwjs implementation seems equally troublesome to use: https://github.com/nwjs/nw.js/wiki/prot ... 8-snapshot
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Implementing V8 snapshot feature in CEF

Postby magreenblatt » Thu May 04, 2017 11:46 am

For source code protection you could load your resources from a password-protected zip archive and disable access to DevTools so that nobody can view source.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm


Return to CEF Discussion

Who is online

Users browsing this forum: No registered users and 23 guests