Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron: verification should be faster #716

Closed
feross opened this issue Apr 2, 2016 · 2 comments
Closed

Electron: verification should be faster #716

feross opened this issue Apr 2, 2016 · 2 comments

Comments

@feross
Copy link
Member

@feross feross commented Apr 2, 2016

Prompted by this comment by @dcposch: 664eb30#commitcomment-16936882

simple-sha1 uses async methods to do hashing off the main thread (in browsers that support it). So, using the number of cores actually makes a lot of sense. Support list: http://caniuse.com/#feat=cryptography

This is not working correctly in Electron because Electron ignores the "browser" field in package.json.

Current time to verify an 8GB test torrent on two separate runs:

52089.942ms
58375.643ms

feross referenced this issue Apr 2, 2016
@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Apr 2, 2016

I just learned that crypto.subtle uses a thread pool of size 1 in Chrome :( Issue: https://bugs.chromium.org/p/chromium/issues/detail?id=449009 but larger in other browsers.

So it seems like merely making Electron use crypto.subtle is not a solution.

I tried making a worker pool, but it's slowed down by the size of data that needs to be sent to each worker and didn't work reliably with torrents that had really large (~8MB) piece sizes. Too bad IPC calls don't work more like WebWorkers which support instantly transferring binary data to a worker (transferrable objects).

The need for this is obviated (at least for webtorrent-desktop) by this PR: #715

@feross feross closed this Apr 2, 2016
@feross feross mentioned this issue Apr 2, 2016
10 of 11 tasks complete
@lock

This comment has been minimized.

Copy link

@lock lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.