Skip to content
This repository has been archived by the owner on May 26, 2021. It is now read-only.

Test to demonstrate gRPC slowdown when running in an Electron Renderer process on Windows

License

Notifications You must be signed in to change notification settings

descriptinc/grpc-electron-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grpc-electron-test

A grpc-node message roundtrip is slow when running on a renderer process of Electron on Windows. This repo is a demonstration of that.

To run:

yarn install
# in one terminal
node example/greeter_server.js
# in another terminal
yarn start

It runs the same gRPC test in the main process and in the renderer process and then shows the results in the renderer BrowserWindow. It computes the average roundtrip time for a simple gRPC message (200 messages, sent at an interval of 10 ms. The problem persists even if the interval is much greater).

On Windows I get a result like:

Average gRPC roundtrip (running in main): 0.62ms
Average gRPC roundtrip (running in renderer): 145.94ms

While on macOS I get a result like:

Average roundtrip (running in main): 1.29ms
Average roundtrip (running in renderer): 1.33ms

I'm guessing that this is somehow related to the different way that Windows and Mac/Linux implement the node.js runtime binding in the renderer process, i.e., https://github.com/electron/electron/blob/master/atom/common/node_bindings_win.cc vs. https://github.com/electron/electron/blob/master/atom/common/node_bindings_mac.cc


electron-quick-start (original readme)

Clone and run for a quick way to see Electron in action.

This is a minimal Electron application based on the Quick Start Guide within the Electron documentation.

Use this app along with the Electron API Demos app for API code examples to help you get started.

A basic Electron application needs just these files:

  • package.json - Points to the app's main file and lists its details and dependencies.
  • main.js - Starts the app and creates a browser window to render HTML. This is the app's main process.
  • index.html - A web page to render. This is the app's renderer process.

You can learn more about each of these components within the Quick Start Guide.

To Use

To clone and run this repository you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Clone this repository
git clone https://github.com/electron/electron-quick-start
# Go into the repository
cd electron-quick-start
# Install dependencies
npm install
# Run the app
npm start

Note: If you're using Linux Bash for Windows, see this guide or use node from the command prompt.

Resources for Learning Electron

License

CC0 1.0 (Public Domain)

About

Test to demonstrate gRPC slowdown when running in an Electron Renderer process on Windows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published