Skip to content

Conversation

gi-dellav
Copy link

@gi-dellav gi-dellav commented Jul 2, 2022

This pull requests introduces v8-compile-cache, a small library that speed up instantiation time using V8's code cache system.
At the moment, v8-compile-cache is used in js/default.js and main/main.js.
If needed, require('v8-compile-cache); can be used in other modules if they need a (little) speed up.

@gi-dellav gi-dellav changed the title v8-compile-cache for (slightly) faster load times v8-compile-cache for (slightly) faster load times & DRM support Jul 2, 2022
@gi-dellav
Copy link
Author

gi-dellav commented Jul 2, 2022

This pull request got expanded, beacuse now it also adds (experimental) Widevine support for websites like Netflix or Spotify.

How does it work?

If possible, Min will load the Widevine libraries from an installed instance of Google Chrome and it will load it with Electron.

Why does it use this method?

The main three reasons are:

  • This is the easiest way without a license
  • This is used by the Electron.js doc itself
  • This is also used by some Kodi extensions for playing multimedia content protected by Widevine

On which platform does it work?

The code support Linux, Windows and MacOS, for x86 both for 32 and 64bits, but this support for the DRM requires testing on all of the platforms.
In the feature, I hope that support for MacOS on Apple Silicon could be implemented (I use Linux, so I can't test it).

Why is this one big pull request and not two?

This is beacuse with this pull requests all the dependencies for the project got updated to the latest version, resolving many security and compatibility issues, so both the changes are tested with this new project update.

@gi-dellav gi-dellav changed the title v8-compile-cache for (slightly) faster load times & DRM support v8-compile-cache for faster loading times & DRM support Jul 2, 2022
@PalmerAL
Copy link
Collaborator

PalmerAL commented Jul 5, 2022

Have you measured this before/after to see if it's faster? The reason I ask is that for main.js, the amount of code loaded is pretty small, so I wouldn't expect caching to make much difference. For default.js (which is fairly large), Electron should have code caching enabled already: https://www.electronjs.org/docs/latest/api/browser-window#new-browserwindowoptions (see "v8CacheOptions").

For Widevine - I don't understand the licensing well enough to know what's permissible or not at the moment. In order to avoid potential issues, I think it's best not to support that. Sorry.

@gi-dellav
Copy link
Author

Hi.

I've checked, and Electron.js does (by default) use code caching.
For Widevine, I understand the possibility for legal issue.

I'll close this PR, but I will chec the Widevine License/ToS for checking if is possible to embed the DRM (legally).

@gi-dellav gi-dellav closed this Jul 6, 2022
@gi-dellav
Copy link
Author

In the PR I also update the dependencies for the project; if you wish, I can make another PR with just the updates. (see package.json from this commit)

I also fixed a bug that blocked the use of SharedArrayBuffers (without this API sites like Google Earth can't run) in this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants