SlideShare a Scribd company logo
1Samsung Open Source Group
JerryScript
An ultra-lightweight JavaScript engine for the Internet of Things
Tilmann Scheller
Principal Compiler Engineer
t.scheller@samsung.com
Samsung Open Source Group
Samsung Research UK
OpenIoT Summit Europe 2016
Berlin, Germany, October 11 – 13, 2016
2Samsung Open Source Group
Overview
● Introduction
● JerryScript
● JerryScript Internals Overview
● Memory consumption/Performance
● Demo
● Future work
● Summary
3Samsung Open Source Group
Introduction
4Samsung Open Source Group
What is JerryScript?
● A really lightweight JavaScript engine
● Has a base footprint of ~3KB of RAM
● Optimized for microcontrollers
● Originally developed from scratch by Samsung
● JerryScript is an open source project released under the
Apache License 2.0
● Actively developed on GitHub
5Samsung Open Source Group
Why JavaScript on microcontrollers?
● There's a huge pool of JavaScript developers
● Opens up the possibility for web developers to easily write
software for embedded devices
● Performance overhead of JavaScript less of an issue for
control tasks
● Increased productivity, shorter time to market
● Ability to load code dynamically over the network
● Security: Executing JavaScript code is safer than executing
arbitrary native code
6Samsung Open Source Group
JerryScript
7Samsung Open Source Group
JerryScript History
● Development started in June 2014
● Released as open source in June 2015
● JerryScript passed 100% of the test262 conformance test
suite in August 2015
● Rewritten compact byte code implementation landed in
January 2016
● JerryScript 1.0 released in September 2016
● Current focus on usability
8Samsung Open Source Group
JerryScript
● Heavily optimized for a low memory footprint
● Interpreter-only
● Compact object representation
● Compressed pointers
● No AST, directly creating byte code
● Compact byte code heavily optimized for low memory
consumption
9Samsung Open Source Group
JerryScript Portability
● Extremely portable
● Self-contained
● Small C library
● Can run bare-metal
● Supports the STM32F4, Arduino 101, FRDM-K64F,
ESP8266 (experimental) boards
● OS support: NuttX, Zephyr, mbed OS, RIOT
● Runs on Linux/macOS as well
10Samsung Open Source Group
JerryScript
● Written in C99
● About 84KLOC
● Code size 156KB when compiled with GCC in LTO mode
for ARM Thumb-2
● Implements the entire ECMAScript 5.1 standard, passes
100% of the test262 conformance test suite
● C API for embedding JerryScript
● Byte code snapshot feature
11Samsung Open Source Group
Target hardware
● STM32F4 developer board
● Cortex-M4F clocked at 168 MHz
● 192KB of RAM
● 1MB of flash memory
12Samsung Open Source Group
Target hardware
● Particle Photon board
● Cortex-M3 clocked at 120 MHz
● 128KB of RAM
● 1MB of flash memory
● Wi-Fi integrated
● Small footprint (37mm x 20mm)
13Samsung Open Source Group
JerryScript C API
14Samsung Open Source Group
JerryScript C API
15Samsung Open Source Group
JerryScript Internals Overview
16Samsung Open Source Group
High-Level Design Overview
17Samsung Open Source Group
Parser Overview
● Optimized for low memory consumption
– E.g. only 41KB of memory is required to parse the 95KB of
concatenated IoT.js source code
● 12.5KB byte code, 10KB literal references,
12.2KB literal storage data, 7KB for parser temporaries
● Generates byte code directly
– No intermediate representation (e.g. AST)
● Recursive descent parser
– The parser uses a byte array for the parser stack
instead of calling functions recursively
18Samsung Open Source Group
Compact Byte Code (CBC)
● CBC is a variable-length byte code
● Currently 306 opcodes are defined
– Majority of the opcodes are variants of the same operation
● E.g. “this.name” is a frequent expression in JavaScript so
an opcode is defined to resolve this expression
– Usually this operation is constructed from multiple opcodes:
op_load_this, op_load_name, op_resolve
– Other examples: “a.b(c,d)” or “i++”
19Samsung Open Source Group
Compact Byte Code Interpreter
● The interpreter is a combination of a register and stack
machine
– The stack is used to compute temporary values
– The registers are used to store local variables
● Byte code decompression
– Byte code instructions are decoded into a maximum of
three atomic instructions and those instructions are
executed by the interpreter
20Samsung Open Source Group
Compressed Pointers
● Compressed pointers are 16-bit values, which represent
8 byte aligned addresses on the JerryScript heap
– Saves 50% of memory on 32-bit systems
● The JerryScript heap is a linear memory space with a
maximum size of 512KB (equals to UINT16_MAX * 8)
– UINT16_MAX is 65535
● Pointer compression can also be turned off to enable a
maximum heap size of 4GB
21Samsung Open Source Group
Value Representation
● JavaScript is a dynamically typed language
– All values carry type information as well
● ECMAScript values in JerryScript are 32-bit wide
– They can be primitive values (true, null, undefined, …)
or pointers to numbers, strings or objects
● On 32-bit systems, 29 bits are enough to directly store
any 8 byte aligned 32-bit pointer
22Samsung Open Source Group
String Representation
● String descriptor is 8 bytes long
● Several string types are supported in JerryScript besides
the usual character array
– Short strings: Stored in the 32-bit value field
– Magic (frequently used) string indices
23Samsung Open Source Group
Number Representation
● Numbers are double precision values by default
● Optional mode for single precision values
– Single precision numbers do not satisfy the
ECMAScript requirements but can be computed faster,
trading precision for performance
24Samsung Open Source Group
Object Representation
● Garbage collector can visit all existing objects
● Objects have a property list
– Named data, named accessor properties
– Internal properties
● Functions are objects in JavaScript
25Samsung Open Source Group
Memory consumption/
Performance
26Samsung Open Source Group
SunSpider 1.0.2 - Memory consumption
3d-cube
3d-raytrace
access-binary-trees
access-fannkuch
access-nbody
bitops-3bit-bits-in-byte
bitops-bits-in-byte
bitops-bitwise-and
bitops-nsieve-bits
controlflow-recursive
crypto-aes
crypto-md5
crypto-sha1
date-format-tofte
date-format-xparb
math-cordic
math-partial-sums
math-spectral-norm
string-base64
string-fasta
0 50 100 150 200 250 300 350 400
35
185
38
11
11
5
5
4
139
80
57
142
92
21
21
6
5
12
125
20
138
339
160
101
106
98
97
97
207
135
190
261
169
352
147
102
101
102
267
107
JerryScript 1.0
Duktape 1.5.1
Max RSS in KB (lower is better) Measured on a Raspberry Pi 2
27Samsung Open Source Group
SunSpider 1.0.2 - Performance
3d-cube
3d-raytrace
access-binary-trees
access-fannkuch
access-nbody
bitops-3bit-bits-in-byte
bitops-bits-in-byte
bitops-bitwise-and
bitops-nsieve-bits
controlflow-recursive
crypto-aes
crypto-md5
crypto-sha1
date-format-tofte
date-format-xparb
math-cordic
math-partial-sums
math-spectral-norm
string-base64
string-fasta
0 1 2 3 4 5 6 7 8
0.94
1.11
0.59
2.38
1.08
0.58
0.85
1.01
1.8
0.38
1.11
0.73
0.7
0.87
0.47
1.33
0.73
0.58
2.06
1.39
1.01
1.62
1.23
2.19
1.65
1.51
1.71
7.4
2.88
1.13
1.76
1.44
1.33
3.08
1.64
2.56
2.69
0.83
4.18
4.53
JerryScript 1.0
Duktape 1.5.1
Execution time in seconds (lower is better) Measured on a Raspberry Pi 2
28Samsung Open Source Group
Demo
29Samsung Open Source Group
Pong Demo
● Implementation of the classic Pong game
● Display shared across two devices
● Each device drives one LED matrix
● Implemented as a Node.js module
● "AI" oppenent running on the microcontroller
30Samsung Open Source Group
Pong Demo
Raspberry Pi 2
(1GB RAM, 8GB Flash)
Pong Client
Node.js
V8
Linux
STM32F4 board
(192KB RAM, 1MB Flash)
Pong Server
IoT.js
JerryScript
NuttX
Ethernet
USB Keypad
LED Matrix LED Matrix
I2C I2C
31Samsung Open Source Group
Pong Demo
32Samsung Open Source Group
JerryScript 6LoWPAN Demo
● Multiplayer implementation of the classic Pong/Tetris
game
● Each device drives one LED matrix as display
● Game implemented in JavaScript
● Running on Photon boards
● Low-power wireless communication via 6LoWPAN
33Samsung Open Source Group
JerryScript 6LoWPAN Demo
Raspberry Pi 2
(1GB RAM, 8GB Flash)
Pong/Tetris
JerryScript
Linux
Particle Photon
(128KB RAM, 1MB Flash)
Pong/Tetris
JerryScript
RIOT
USB Keypad
LED Matrix LED Matrix
I2C I2C
Switches via GPIO
6LoWPAN
Live demo will be shown
during ELCE Technical Showcase!
Wednesday, 5:20 PM - 7:00 PM
34Samsung Open Source Group
Future work
35Samsung Open Source Group
Future work
● Further performance and memory optimizations
● Debugging support
● Memory profiling
● Selected ES6 features
● Support for more boards
36Samsung Open Source Group
Summary
37Samsung Open Source Group
Summary
● Significantly lowers barrier of entry for JavaScript
development targeting heavily constrained embedded
devices
● Speeds up development
● Active community
● More information on http://jerryscript.net
● Looking for bug reports and feedback
Thank you.
38Samsung Open Source Group
39Samsung Open Source Group
Contact Information:
Tilmann Scheller
t.scheller@samsung.com
Samsung Open Source Group
Samsung Research UK
Ad

More Related Content

What's hot (20)

Clang: More than just a C/C++ Compiler
Clang: More than just a C/C++ CompilerClang: More than just a C/C++ Compiler
Clang: More than just a C/C++ Compiler
Samsung Open Source Group
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Samsung Open Source Group
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Samsung Open Source Group
 
Introduction to IoT.JS
Introduction to IoT.JSIntroduction to IoT.JS
Introduction to IoT.JS
Samsung Open Source Group
 
Linux Kernel Status Report for IEEE 802.15.4 & 6LoWPAN
Linux Kernel Status Report for IEEE 802.15.4 & 6LoWPANLinux Kernel Status Report for IEEE 802.15.4 & 6LoWPAN
Linux Kernel Status Report for IEEE 802.15.4 & 6LoWPAN
Samsung Open Source Group
 
P4 to OpenDataPlane Compiler - BUD17-304
P4 to OpenDataPlane Compiler - BUD17-304P4 to OpenDataPlane Compiler - BUD17-304
P4 to OpenDataPlane Compiler - BUD17-304
Linaro
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
Samsung Open Source Group
 
Ryu sdn framework
Ryu sdn framework Ryu sdn framework
Ryu sdn framework
Isaku Yamahata
 
A Close Look at ARM Code Size
A Close Look at ARM Code SizeA Close Look at ARM Code Size
A Close Look at ARM Code Size
Samsung Open Source Group
 
TCP over 6LoWPAN for Industrial Applications
TCP over 6LoWPAN for Industrial ApplicationsTCP over 6LoWPAN for Industrial Applications
TCP over 6LoWPAN for Industrial Applications
Ahmed Ayadi
 
CentOS NFV SIG Introduction and Update
CentOS NFV SIG Introduction and UpdateCentOS NFV SIG Introduction and Update
CentOS NFV SIG Introduction and Update
Tom Herbert
 
Vigor 3910 docker firmware quick start
Vigor 3910 docker firmware quick startVigor 3910 docker firmware quick start
Vigor 3910 docker firmware quick start
Jimmy Tu
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
Samsung Open Source Group
 
Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509
Linaro
 
Ryu SDN Framework
Ryu SDN FrameworkRyu SDN Framework
Ryu SDN Framework
APNIC
 
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from HellLAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
Linaro
 
Switchdev - No More SDK
Switchdev - No More SDKSwitchdev - No More SDK
Switchdev - No More SDK
Kernel TLV
 
Development Boards for Tizen IoT
Development Boards for Tizen IoTDevelopment Boards for Tizen IoT
Development Boards for Tizen IoT
Samsung Open Source Group
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
Linaro
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPCilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDP
Thomas Graf
 
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT DevicesTizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Tizen RT: A Lightweight RTOS Platform for Low-End IoT Devices
Samsung Open Source Group
 
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under LinuxPractical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Practical Guide to Run an IEEE 802.15.4 Network with 6LoWPAN Under Linux
Samsung Open Source Group
 
Linux Kernel Status Report for IEEE 802.15.4 & 6LoWPAN
Linux Kernel Status Report for IEEE 802.15.4 & 6LoWPANLinux Kernel Status Report for IEEE 802.15.4 & 6LoWPAN
Linux Kernel Status Report for IEEE 802.15.4 & 6LoWPAN
Samsung Open Source Group
 
P4 to OpenDataPlane Compiler - BUD17-304
P4 to OpenDataPlane Compiler - BUD17-304P4 to OpenDataPlane Compiler - BUD17-304
P4 to OpenDataPlane Compiler - BUD17-304
Linaro
 
IoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT InteroperabilityIoTivity for Automotive IoT Interoperability
IoTivity for Automotive IoT Interoperability
Samsung Open Source Group
 
TCP over 6LoWPAN for Industrial Applications
TCP over 6LoWPAN for Industrial ApplicationsTCP over 6LoWPAN for Industrial Applications
TCP over 6LoWPAN for Industrial Applications
Ahmed Ayadi
 
CentOS NFV SIG Introduction and Update
CentOS NFV SIG Introduction and UpdateCentOS NFV SIG Introduction and Update
CentOS NFV SIG Introduction and Update
Tom Herbert
 
Vigor 3910 docker firmware quick start
Vigor 3910 docker firmware quick startVigor 3910 docker firmware quick start
Vigor 3910 docker firmware quick start
Jimmy Tu
 
Rapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USBRapid SPi Device Driver Development over USB
Rapid SPi Device Driver Development over USB
Samsung Open Source Group
 
Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509
Linaro
 
Ryu SDN Framework
Ryu SDN FrameworkRyu SDN Framework
Ryu SDN Framework
APNIC
 
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from HellLAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
LAS16-500: The Rise and Fall of Assembler and the VGIC from Hell
Linaro
 
Switchdev - No More SDK
Switchdev - No More SDKSwitchdev - No More SDK
Switchdev - No More SDK
Kernel TLV
 
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and ApproachesBUD17-104: Scripting Languages in IoT: Challenges and Approaches
BUD17-104: Scripting Languages in IoT: Challenges and Approaches
Linaro
 
Cilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDPCilium - Fast IPv6 Container Networking with BPF and XDP
Cilium - Fast IPv6 Container Networking with BPF and XDP
Thomas Graf
 

Viewers also liked (9)

From Idea to Corporate-Sponsored Open Source Project
From Idea to Corporate-Sponsored Open Source ProjectFrom Idea to Corporate-Sponsored Open Source Project
From Idea to Corporate-Sponsored Open Source Project
Samsung Open Source Group
 
Samsung & The Path to Open Source Leadership
Samsung & The Path to Open Source LeadershipSamsung & The Path to Open Source Leadership
Samsung & The Path to Open Source Leadership
Samsung Open Source Group
 
Tizen Connected with IoTivity
Tizen Connected with IoTivityTizen Connected with IoTivity
Tizen Connected with IoTivity
Samsung Open Source Group
 
Toward "OCF Automotive" profile
Toward "OCF Automotive" profileToward "OCF Automotive" profile
Toward "OCF Automotive" profile
Samsung Open Source Group
 
OIC AGL Collaboration
OIC AGL CollaborationOIC AGL Collaboration
OIC AGL Collaboration
Samsung Open Source Group
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
Samsung Open Source Group
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
Samsung Open Source Group
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
Samsung Open Source Group
 
Why your project's brand is more important than the code
Why your project's brand is more important than the codeWhy your project's brand is more important than the code
Why your project's brand is more important than the code
Shane Curcuru
 
From Idea to Corporate-Sponsored Open Source Project
From Idea to Corporate-Sponsored Open Source ProjectFrom Idea to Corporate-Sponsored Open Source Project
From Idea to Corporate-Sponsored Open Source Project
Samsung Open Source Group
 
Samsung & The Path to Open Source Leadership
Samsung & The Path to Open Source LeadershipSamsung & The Path to Open Source Leadership
Samsung & The Path to Open Source Leadership
Samsung Open Source Group
 
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivityIoT: From Arduino Microcontrollers to Tizen Products using IoTivity
IoT: From Arduino Microcontrollers to Tizen Products using IoTivity
Samsung Open Source Group
 
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/LinuxIoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
IoTivity Tutorial: Prototyping IoT Devices on GNU/Linux
Samsung Open Source Group
 
Why your project's brand is more important than the code
Why your project's brand is more important than the codeWhy your project's brand is more important than the code
Why your project's brand is more important than the code
Shane Curcuru
 
Ad

Similar to JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things (20)

Introduction to IoT.JS
Introduction to IoT.JSIntroduction to IoT.JS
Introduction to IoT.JS
Samsung Open Source Group
 
Js on-microcontrollers
Js on-microcontrollersJs on-microcontrollers
Js on-microcontrollers
Seo-Young Hwang
 
IBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache SparkIBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache Spark
AdamRobertsIBM
 
Apache Spark Performance Observations
Apache Spark Performance ObservationsApache Spark Performance Observations
Apache Spark Performance Observations
Adam Roberts
 
Threading Successes 06 Allegorithmic
Threading Successes 06   AllegorithmicThreading Successes 06   Allegorithmic
Threading Successes 06 Allegorithmic
guest40fc7cd
 
0xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp020xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp02
chon2010
 
[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene
[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene
[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene
OpenStack Korea Community
 
Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7
Kynetics
 
EFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the DesktopEFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the Desktop
Samsung Open Source Group
 
cachegrand: A Take on High Performance Caching
cachegrand: A Take on High Performance Cachingcachegrand: A Take on High Performance Caching
cachegrand: A Take on High Performance Caching
ScyllaDB
 
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
Rob Skillington
 
I pod new
I pod newI pod new
I pod new
Abhijit Ghosh
 
ARM.pdf
ARM.pdfARM.pdf
ARM.pdf
SnehaSoni72
 
Arm developement
Arm developementArm developement
Arm developement
hirokiht
 
CAPI and OpenCAPI Hardware acceleration enablement
CAPI and OpenCAPI Hardware acceleration enablementCAPI and OpenCAPI Hardware acceleration enablement
CAPI and OpenCAPI Hardware acceleration enablement
Ganesan Narayanasamy
 
AWS Graviton3 and GP3
AWS Graviton3 and GP3AWS Graviton3 and GP3
AWS Graviton3 and GP3
Olaf Reitmaier Veracierta
 
Optimizing Servers for High-Throughput and Low-Latency at Dropbox
Optimizing Servers for High-Throughput and Low-Latency at DropboxOptimizing Servers for High-Throughput and Low-Latency at Dropbox
Optimizing Servers for High-Throughput and Low-Latency at Dropbox
ScyllaDB
 
Open HFT libraries in @Java
Open HFT libraries in @JavaOpen HFT libraries in @Java
Open HFT libraries in @Java
Peter Lawrey
 
Lrz kurs: big data analysis
Lrz kurs: big data analysisLrz kurs: big data analysis
Lrz kurs: big data analysis
Ferdinand Jamitzky
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark faster
Tim Ellison
 
IBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache SparkIBM Runtimes Performance Observations with Apache Spark
IBM Runtimes Performance Observations with Apache Spark
AdamRobertsIBM
 
Apache Spark Performance Observations
Apache Spark Performance ObservationsApache Spark Performance Observations
Apache Spark Performance Observations
Adam Roberts
 
Threading Successes 06 Allegorithmic
Threading Successes 06   AllegorithmicThreading Successes 06   Allegorithmic
Threading Successes 06 Allegorithmic
guest40fc7cd
 
0xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp020xdroid osdc-2010-100426084937-phpapp02
0xdroid osdc-2010-100426084937-phpapp02
chon2010
 
[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene
[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene
[OpenStack Days Korea 2016] Track3 - OpenStack on 64-bit ARM with X-Gene
OpenStack Korea Community
 
Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7
Kynetics
 
EFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the DesktopEFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the Desktop
Samsung Open Source Group
 
cachegrand: A Take on High Performance Caching
cachegrand: A Take on High Performance Cachingcachegrand: A Take on High Performance Caching
cachegrand: A Take on High Performance Caching
ScyllaDB
 
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
FOSDEM 2019: M3, Prometheus and Graphite with metrics and monitoring in an in...
Rob Skillington
 
Arm developement
Arm developementArm developement
Arm developement
hirokiht
 
CAPI and OpenCAPI Hardware acceleration enablement
CAPI and OpenCAPI Hardware acceleration enablementCAPI and OpenCAPI Hardware acceleration enablement
CAPI and OpenCAPI Hardware acceleration enablement
Ganesan Narayanasamy
 
Optimizing Servers for High-Throughput and Low-Latency at Dropbox
Optimizing Servers for High-Throughput and Low-Latency at DropboxOptimizing Servers for High-Throughput and Low-Latency at Dropbox
Optimizing Servers for High-Throughput and Low-Latency at Dropbox
ScyllaDB
 
Open HFT libraries in @Java
Open HFT libraries in @JavaOpen HFT libraries in @Java
Open HFT libraries in @Java
Peter Lawrey
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark faster
Tim Ellison
 
Ad

More from Samsung Open Source Group (10)

The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)The Complex IoT Equation (and FLOSS solutions)
The Complex IoT Equation (and FLOSS solutions)
Samsung Open Source Group
 
Easy IoT with JavaScript
Easy IoT with JavaScriptEasy IoT with JavaScript
Easy IoT with JavaScript
Samsung Open Source Group
 
Spawny: A New Approach to Logins
Spawny: A New Approach to LoginsSpawny: A New Approach to Logins
Spawny: A New Approach to Logins
Samsung Open Source Group
 
IoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and BeyondIoTivity: Smart Home to Automotive and Beyond
IoTivity: Smart Home to Automotive and Beyond
Samsung Open Source Group
 
IoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorialIoTivity for Automotive: meta-ocf-automotive tutorial
IoTivity for Automotive: meta-ocf-automotive tutorial
Samsung Open Source Group
 
GENIVI + OCF Cooperation
GENIVI + OCF CooperationGENIVI + OCF Cooperation
GENIVI + OCF Cooperation
Samsung Open Source Group
 
Framework for IoT Interoperability
Framework for IoT InteroperabilityFramework for IoT Interoperability
Framework for IoT Interoperability
Samsung Open Source Group
 
Open Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate StrategyOpen Source Metrics to Inform Corporate Strategy
Open Source Metrics to Inform Corporate Strategy
Samsung Open Source Group
 
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devicesIoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
IoTivity Connects RVI from GENIVI's Develoment Platform to Tizen devices
Samsung Open Source Group
 
IoTivity on Tizen: How to
IoTivity on Tizen: How toIoTivity on Tizen: How to
IoTivity on Tizen: How to
Samsung Open Source Group
 

Recently uploaded (20)

Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Revolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptxRevolutionizing Residential Wi-Fi PPT.pptx
Revolutionizing Residential Wi-Fi PPT.pptx
nidhisingh691197
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025PDF Reader Pro Crack Latest Version FREE Download 2025
PDF Reader Pro Crack Latest Version FREE Download 2025
mu394968
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 

JerryScript: An ultra-lighteweight JavaScript Engine for the Internet of Things

  • 1. 1Samsung Open Source Group JerryScript An ultra-lightweight JavaScript engine for the Internet of Things Tilmann Scheller Principal Compiler Engineer [email protected] Samsung Open Source Group Samsung Research UK OpenIoT Summit Europe 2016 Berlin, Germany, October 11 – 13, 2016
  • 2. 2Samsung Open Source Group Overview ● Introduction ● JerryScript ● JerryScript Internals Overview ● Memory consumption/Performance ● Demo ● Future work ● Summary
  • 3. 3Samsung Open Source Group Introduction
  • 4. 4Samsung Open Source Group What is JerryScript? ● A really lightweight JavaScript engine ● Has a base footprint of ~3KB of RAM ● Optimized for microcontrollers ● Originally developed from scratch by Samsung ● JerryScript is an open source project released under the Apache License 2.0 ● Actively developed on GitHub
  • 5. 5Samsung Open Source Group Why JavaScript on microcontrollers? ● There's a huge pool of JavaScript developers ● Opens up the possibility for web developers to easily write software for embedded devices ● Performance overhead of JavaScript less of an issue for control tasks ● Increased productivity, shorter time to market ● Ability to load code dynamically over the network ● Security: Executing JavaScript code is safer than executing arbitrary native code
  • 6. 6Samsung Open Source Group JerryScript
  • 7. 7Samsung Open Source Group JerryScript History ● Development started in June 2014 ● Released as open source in June 2015 ● JerryScript passed 100% of the test262 conformance test suite in August 2015 ● Rewritten compact byte code implementation landed in January 2016 ● JerryScript 1.0 released in September 2016 ● Current focus on usability
  • 8. 8Samsung Open Source Group JerryScript ● Heavily optimized for a low memory footprint ● Interpreter-only ● Compact object representation ● Compressed pointers ● No AST, directly creating byte code ● Compact byte code heavily optimized for low memory consumption
  • 9. 9Samsung Open Source Group JerryScript Portability ● Extremely portable ● Self-contained ● Small C library ● Can run bare-metal ● Supports the STM32F4, Arduino 101, FRDM-K64F, ESP8266 (experimental) boards ● OS support: NuttX, Zephyr, mbed OS, RIOT ● Runs on Linux/macOS as well
  • 10. 10Samsung Open Source Group JerryScript ● Written in C99 ● About 84KLOC ● Code size 156KB when compiled with GCC in LTO mode for ARM Thumb-2 ● Implements the entire ECMAScript 5.1 standard, passes 100% of the test262 conformance test suite ● C API for embedding JerryScript ● Byte code snapshot feature
  • 11. 11Samsung Open Source Group Target hardware ● STM32F4 developer board ● Cortex-M4F clocked at 168 MHz ● 192KB of RAM ● 1MB of flash memory
  • 12. 12Samsung Open Source Group Target hardware ● Particle Photon board ● Cortex-M3 clocked at 120 MHz ● 128KB of RAM ● 1MB of flash memory ● Wi-Fi integrated ● Small footprint (37mm x 20mm)
  • 13. 13Samsung Open Source Group JerryScript C API
  • 14. 14Samsung Open Source Group JerryScript C API
  • 15. 15Samsung Open Source Group JerryScript Internals Overview
  • 16. 16Samsung Open Source Group High-Level Design Overview
  • 17. 17Samsung Open Source Group Parser Overview ● Optimized for low memory consumption – E.g. only 41KB of memory is required to parse the 95KB of concatenated IoT.js source code ● 12.5KB byte code, 10KB literal references, 12.2KB literal storage data, 7KB for parser temporaries ● Generates byte code directly – No intermediate representation (e.g. AST) ● Recursive descent parser – The parser uses a byte array for the parser stack instead of calling functions recursively
  • 18. 18Samsung Open Source Group Compact Byte Code (CBC) ● CBC is a variable-length byte code ● Currently 306 opcodes are defined – Majority of the opcodes are variants of the same operation ● E.g. “this.name” is a frequent expression in JavaScript so an opcode is defined to resolve this expression – Usually this operation is constructed from multiple opcodes: op_load_this, op_load_name, op_resolve – Other examples: “a.b(c,d)” or “i++”
  • 19. 19Samsung Open Source Group Compact Byte Code Interpreter ● The interpreter is a combination of a register and stack machine – The stack is used to compute temporary values – The registers are used to store local variables ● Byte code decompression – Byte code instructions are decoded into a maximum of three atomic instructions and those instructions are executed by the interpreter
  • 20. 20Samsung Open Source Group Compressed Pointers ● Compressed pointers are 16-bit values, which represent 8 byte aligned addresses on the JerryScript heap – Saves 50% of memory on 32-bit systems ● The JerryScript heap is a linear memory space with a maximum size of 512KB (equals to UINT16_MAX * 8) – UINT16_MAX is 65535 ● Pointer compression can also be turned off to enable a maximum heap size of 4GB
  • 21. 21Samsung Open Source Group Value Representation ● JavaScript is a dynamically typed language – All values carry type information as well ● ECMAScript values in JerryScript are 32-bit wide – They can be primitive values (true, null, undefined, …) or pointers to numbers, strings or objects ● On 32-bit systems, 29 bits are enough to directly store any 8 byte aligned 32-bit pointer
  • 22. 22Samsung Open Source Group String Representation ● String descriptor is 8 bytes long ● Several string types are supported in JerryScript besides the usual character array – Short strings: Stored in the 32-bit value field – Magic (frequently used) string indices
  • 23. 23Samsung Open Source Group Number Representation ● Numbers are double precision values by default ● Optional mode for single precision values – Single precision numbers do not satisfy the ECMAScript requirements but can be computed faster, trading precision for performance
  • 24. 24Samsung Open Source Group Object Representation ● Garbage collector can visit all existing objects ● Objects have a property list – Named data, named accessor properties – Internal properties ● Functions are objects in JavaScript
  • 25. 25Samsung Open Source Group Memory consumption/ Performance
  • 26. 26Samsung Open Source Group SunSpider 1.0.2 - Memory consumption 3d-cube 3d-raytrace access-binary-trees access-fannkuch access-nbody bitops-3bit-bits-in-byte bitops-bits-in-byte bitops-bitwise-and bitops-nsieve-bits controlflow-recursive crypto-aes crypto-md5 crypto-sha1 date-format-tofte date-format-xparb math-cordic math-partial-sums math-spectral-norm string-base64 string-fasta 0 50 100 150 200 250 300 350 400 35 185 38 11 11 5 5 4 139 80 57 142 92 21 21 6 5 12 125 20 138 339 160 101 106 98 97 97 207 135 190 261 169 352 147 102 101 102 267 107 JerryScript 1.0 Duktape 1.5.1 Max RSS in KB (lower is better) Measured on a Raspberry Pi 2
  • 27. 27Samsung Open Source Group SunSpider 1.0.2 - Performance 3d-cube 3d-raytrace access-binary-trees access-fannkuch access-nbody bitops-3bit-bits-in-byte bitops-bits-in-byte bitops-bitwise-and bitops-nsieve-bits controlflow-recursive crypto-aes crypto-md5 crypto-sha1 date-format-tofte date-format-xparb math-cordic math-partial-sums math-spectral-norm string-base64 string-fasta 0 1 2 3 4 5 6 7 8 0.94 1.11 0.59 2.38 1.08 0.58 0.85 1.01 1.8 0.38 1.11 0.73 0.7 0.87 0.47 1.33 0.73 0.58 2.06 1.39 1.01 1.62 1.23 2.19 1.65 1.51 1.71 7.4 2.88 1.13 1.76 1.44 1.33 3.08 1.64 2.56 2.69 0.83 4.18 4.53 JerryScript 1.0 Duktape 1.5.1 Execution time in seconds (lower is better) Measured on a Raspberry Pi 2
  • 28. 28Samsung Open Source Group Demo
  • 29. 29Samsung Open Source Group Pong Demo ● Implementation of the classic Pong game ● Display shared across two devices ● Each device drives one LED matrix ● Implemented as a Node.js module ● "AI" oppenent running on the microcontroller
  • 30. 30Samsung Open Source Group Pong Demo Raspberry Pi 2 (1GB RAM, 8GB Flash) Pong Client Node.js V8 Linux STM32F4 board (192KB RAM, 1MB Flash) Pong Server IoT.js JerryScript NuttX Ethernet USB Keypad LED Matrix LED Matrix I2C I2C
  • 31. 31Samsung Open Source Group Pong Demo
  • 32. 32Samsung Open Source Group JerryScript 6LoWPAN Demo ● Multiplayer implementation of the classic Pong/Tetris game ● Each device drives one LED matrix as display ● Game implemented in JavaScript ● Running on Photon boards ● Low-power wireless communication via 6LoWPAN
  • 33. 33Samsung Open Source Group JerryScript 6LoWPAN Demo Raspberry Pi 2 (1GB RAM, 8GB Flash) Pong/Tetris JerryScript Linux Particle Photon (128KB RAM, 1MB Flash) Pong/Tetris JerryScript RIOT USB Keypad LED Matrix LED Matrix I2C I2C Switches via GPIO 6LoWPAN Live demo will be shown during ELCE Technical Showcase! Wednesday, 5:20 PM - 7:00 PM
  • 34. 34Samsung Open Source Group Future work
  • 35. 35Samsung Open Source Group Future work ● Further performance and memory optimizations ● Debugging support ● Memory profiling ● Selected ES6 features ● Support for more boards
  • 36. 36Samsung Open Source Group Summary
  • 37. 37Samsung Open Source Group Summary ● Significantly lowers barrier of entry for JavaScript development targeting heavily constrained embedded devices ● Speeds up development ● Active community ● More information on http://jerryscript.net ● Looking for bug reports and feedback
  • 39. 39Samsung Open Source Group Contact Information: Tilmann Scheller [email protected] Samsung Open Source Group Samsung Research UK