[2014.11.18] java script execution environment survey

18
JavaScript Execution Environment Survey 2014.11.18. KAIST IT 융융융융융 융융융

Upload: donggyun-han

Post on 11-Apr-2017

452 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: [2014.11.18] java script execution environment survey

JavaScript Execution Environment Survey

2014.11.18.KAIST IT 융합연구소 한동균

Page 2: [2014.11.18] java script execution environment survey

Motivation Instability of Anode

Inactive development of Anode

Structural defect of Anode application

Depending on external service call which is hard to manage whole application

Implementation of native Java based cloudlet platform is almost done

Page 3: [2014.11.18] java script execution environment survey

MotivationApp1

App2Implement two applications which have same behavior but in different language

Implemented in Objective-C

Implemented in Java

Page 4: [2014.11.18] java script execution environment survey

Motivation

App

One Source Multi Use

Implemented in JavaScript

Page 5: [2014.11.18] java script execution environment survey

JS Execution Environment

Anode

V8(Webview)

V8(Zazl)

Rhino

Page 6: [2014.11.18] java script execution environment survey

Anode https://github.com/paddybyers/anode

A port of node.js to the Android OS and libraries

Able to leverage web socket

Unstable execution environment

Not active development

Page 7: [2014.11.18] java script execution environment survey

Anode (cont’d)

node.js is ported by Paddy Byers

Anode is implemented by Paddy Byers

5 contributors on Github (including me)

Not in active development

Page 8: [2014.11.18] java script execution environment survey

V8 (WebView) https://code.google.com/p/v8

Google’s open source JavaScript engine which is written in C++ and used in Chrome.

V8 is the default JavaScript engine of Webkit

Since Webkit runs on UI thread, only one thread per application, we cannot run multi-thread computation leveraging WebView

Page 9: [2014.11.18] java script execution environment survey

V8 (WebView)

Page 10: [2014.11.18] java script execution environment survey

V8 (WebView)

Page 11: [2014.11.18] java script execution environment survey

V8 (Zazl) http://www.zazl.org

Java based server-side JavaScript tools

Zazl contains V8 Java Bridge (i.e. Enable the use of the V8 JavaScript Engine within Java)

Inactive development

Page 12: [2014.11.18] java script execution environment survey

Rhino https://www.mozilla.org/rhino/

An open-source implementation of JavaScript written entirely in Java.

Stable JavaScript computation

Since it is implemented in pure Java, it shows relatively low performance than other JS engines.

Page 13: [2014.11.18] java script execution environment survey

Rhino (cont’d) Implemented by Mozilla developers

Rhino is embedded in Java SE 6 and 7 as the default Java scripting engine

Oracle has announced Nashorn as the default JavaScripting engine in Java SE 8 (JSR-292)

However, Android does not support Java 8 yet.

Page 14: [2014.11.18] java script execution environment survey

Performance Comparison

http://ariya.ofilabs.com/2014/03/nashorn-the-new-rhino-on-the-block.html

Page 15: [2014.11.18] java script execution environment survey

Comparison TableApproach Implemented Stability Maintainabilit

y Performance Complexity

AnodeC/C++

(node.js) with Java

low no more support normal

high(External

Service Call)

V8(WebView) C/C++ high Officially support

low(Single Thread)

low

V8(Zazl) C/C++ with Java high no more

support high low

Rhino Java high no more support

low(Java

Implementation)

low

Nashorn Java high not support yet high low

Page 16: [2014.11.18] java script execution environment survey

Java V8 Bridge Leverage JavaScript V8 Engine in Java via JNI

It guarantees high performance, low complexity, and high stability

Not familiar (JNI, Android NDK), but looks simple

http://www.zazl.org

http://lorinbeer.github.io/tutorial/2013/03/22/vatedroid-embedded-v8-in-android.html

Page 17: [2014.11.18] java script execution environment survey

Java V8 Bridge

C/C++JavaScript V8 Engine

Java

JNI (Java Native Interface)

Android Application

Page 18: [2014.11.18] java script execution environment survey

Comparison TableApproach Implemented Stability Maintainabilit

y Performance Complexity

AnodeC/C++

(node.js) with Java

low no more support normal

high(External

Service Call)

V8(WebView) C/C++ high Officially support

low(Single Thread)

low

V8(Zazl) C/C++ with Java high no more

support high low

Rhino Java high no more support

low(Java

Implementation)

low

Nashorn Java high not support yet high low

V8 Bridge C/C++ with Java high support

ourselves high low