Giter Club home page Giter Club logo

nodeelectronopenfinwebperformance's Introduction

Performance Measurements in Node.js, OpenFin, Electron, and Web

This project is intended to demonstrate the ability of a single node.js server with a single code-based to run in OpenFin and Electron desktop applications as well as any modern web browser simultaneously.

The OpenFin RVM (the ability to dynamically build the installation package via URL) is currently only available for the Windows OS but the company promises to release Mac and Linux versions in the near future. But if you wish to run in those OSs you can manually launch following these instructions: OpenFin CLI for Windows, Mac, and Linux

The Electron version will compile and run based on the OS you are running this project in. It has been tested with in Windows 10, Mac OS X, and Ubuntu Desktop 16 LTS.

More detailed breakdowns of different parts of the code can be read here:

Application screenshots:

OpenFin

OpenFin Screen Shot

Electron

Electron Screen Shot

Web Browser

OpenFin Screen Shot

The project itself performs basic time calculations measuring client, server, and network latencies. A data stream is opened by the client via web-sockets upon which the server sends updates at regular intervals. The updates on the server and the client are both intentionally time consuming so as to generate viable measurements (milliseconds).

Since they are running inside chromium-based OpenFin and Electron APIs they can be written using pure HTML5. And because it is JavaScript and CSS the code can also be ran in any modern web browser achieving greater than 99% reuse.

This was built in Visual Studio Code but can be ran like any other node project. It is using node.js version 6 and the client requires support for Web Workers and the performance.now() function. To start remember to first run

npm install

to get needed dependencies and then

npm start

to start the server. If running in VS Code the launch.json file is already configure so simply press F5.

Once started, it will create an HTTP and WebSocket server listening on port:

//Port settings
const webPort = 5000;

To test electron in development without having to build the installation package run:

npm run electron

To test the openfin in development via the CLI (note this will still perform an installation) run:

npm run openfin

For OpenFin and Electron installation packages, navigate to http://localhost:5000/install, click the Download buttons and follow the instructions to complete installation. For electron it can take a minute or so to build the package once started but the browser will prompt for download when ready.

For the web version, simply navigate to http://localhost:5000/. This will show the same single page seen in the desktop versions.

In any application click the Open Data Stream button to begin generating time measurements.

Additional resources:

nodeelectronopenfinwebperformance's People

Contributors

aesalazar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.