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

refactor: implement ipcRenderer.sendTo in native code for better performance #14285

Merged
merged 1 commit into from
Aug 24, 2018

Conversation

miniak
Copy link
Contributor

@miniak miniak commented Aug 24, 2018

Description of Change

ipcRenderer.sendTo currently sends an internal ELECTRON_BROWSER_SEND_TO message, which is handled by rpc-server.js. This leads to unnecessary native <-> V8 value conversions as the message is forwarded to the target renderer. This PR moves the forwarding to the native code to avoid this overhead.

Tested by sending an IPC with 10 MB buffer to a different renderer and then back + measuring the time it takes for the message to come back:

  • before 480 ms
  • after 420 ms
Checklist
  • PR description included and stakeholders cc'd
  • npm test passes
  • PR title follows semantic commit guidelines
Release Notes

Notes: ipcRenderer.sendTo performance improved by implementing forwarding in native code

@miniak miniak force-pushed the miniak/optimize-send-to branch from 7ee74c8 to ca424b1 Compare August 24, 2018 00:48
Copy link
Member

@deepak1556 deepak1556 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@MarshallOfSound MarshallOfSound merged commit c23e7fa into master Aug 24, 2018
@release-clerk
Copy link

release-clerk bot commented Aug 24, 2018

Release Notes Persisted

ipcRenderer.sendTo performance improved by implementing forwarding in native code

@bpasero
Copy link
Contributor

bpasero commented Aug 27, 2018

@miniak just wondering, is ipcRenderer.sendTo going to the main process first and then to the renderer or is it a true renderer <=> renderer communication?

@miniak
Copy link
Contributor Author

miniak commented Aug 27, 2018

@bpasero I would like to get there eventually, but that’s way more complicated.

@bpasero
Copy link
Contributor

bpasero commented Aug 28, 2018

@miniak ok good to know, thanks for clarifying

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.

4 participants