| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
MoMITPy is a tool that allows you to miniaturize (reduce the memory and size footprint) of a JavaScript interpreter to fit on highly constrained IoT devices. It relies on Duktape JS engine.
To perform the miniaturization of a JS interpreter, MoMITPy uses the mandatory code features of a JavaScript program that you want to execute, and the list of IoT'devices hardware requirements to select the best combination of code features to execute your JS without modifying the source code.
Since, MoMITPy is multiobjective, it generates more than one solution, targeting the ones that can be deployed in more devices from the IoT devices list you provide.
MoMITPy relios on JMetalPy metaheuristic framework.
To download jMetalPy just clone the Git repository hosted in GitHub:
$ git clone https://github.com/jMetal/jMetalPy.git
$ sudo python3 setup.py installTo install Duktape refer to the existing documentation at: https://duktape.org/guide.html
Note that you will need to provide the path to the installation of duktape later.
The scripts for running MoMITPy are located on the /iot subfolder
In this Readme file, as example, we assume that you have a javascript file called date-format-tofte.js (located on the iot subfolder), that you want to miniaturize to run on several constrained IoT devices. For that purpose, you will execute one single run of hybrid random search metaheuristic to generate a set of duktape interpreters that can run your JavaScript, and which minimize the use of code footprint (of the interpreter), memory usage (of the javascript) and execution time.
Note that all the experiments where executed using Linux Fedora 28.
A javascript file that we want to execute on constrained IoT device. In this example we use date-fromat-tofte.js from Sunspider testbed
A CSV file containing the median results measurements of executing the desired javascript program using duktape default measurements. This is generated using python scripts explained on the wiki. For our example, this is the file: median_results_original_default_date-format-tofte.csv
config.ini. This file provides the basic configuration parameters of our framework, including the path to the Duktape installation, the file with the test features, name of the harness file, jsfunction to execute (if any), etc. More information on the wiki.
confOpt.csv file. This file contains the Duktape code features that we want to combine. These are the columns required for this file.
A CSV file containing the mandatory features of the javascript file to execute. for our example, the name is testbed_required_features.csv, which contains the following columns:
USR.csv: a CSV file with the hardware characteristics of the IoT constrained devices where you want to deploy your js interpreter. it contains the following columns:
A harness.C file that will embedded Duktape interpreter to execute (and mesure memory usage) of the JavaScript you wnat to deploy.
$ python3 rs_full_settings.py 1 date-fromat-tofte.jsThis will generate several files which we are going to explain below.
benchmark_date-fromat-tofte_RS
This is just a log file in case of errors or execeptions
/configFiles/optimize
In this directory we store all the configurations that fail ( for example: optimize.yaml.1540604693.6324103.execution_error) and overwrite the file that succed in each test (optimize.yaml). Note that in benchmark_date-fromat-tofte_RS we link the error with the corresponding optimize.yaml..execution_error. This is helps for debugging purposes
/iot/duktape-src
In this folder we stored the files required to benchmark a set of Duktape code features. It includes the headers of duktape (duk_confgi.h, duktape.h, and duktape.c); our embedded duktape javascript compiler (harness.c), the javascript file to execute (for example, date-fromat-tofte.js).
FUN.RS.date-fromat-tofte.js.1.Miniaturization
This file contains the normalized values obtained for the measurements of file size, memory usage, execution time and DSR metric. The normalization of the values is explained on the paper.
HV.RS.date-fromat-tofte.js.1.Miniaturization
This file is the Hypervolume achieved for this run. Note that this is not the correct computation, as it assumes that the reference point is (1,1,1,1), as this is a miniaturization problem, but we do not know which is the maximum value that a set of features can achieved beforehand. Thus, this value has to be computed based on the Nadir point after executing the experiments.
TIME.RS.date-fromat-tofte.js.1
Computing times in seconds of the miniaturization process
VAR.RS.date-fromat-tofte.js.1.Miniaturization
This file contains the list of solutions generated by the metaheuristic (that means the list of configurations that matches the mandatory features provided in file xx) separeted by "[]". You can convert this file to the actual yaml file (the one that compiles a duktape interpreter based on selected features) using var_2_yaml.py script. More details on the wiki.
values_achieved_RS_date-fromat-tofte.js1
This file contains the real values obtained after miniaturizing the duktape interpreter in the following order: file size kb, memory usage (kb), execution time (seconds), and DSR metric (more details on the wiki)
The current release of MoMITPy contains the following components:
MoMITPy is the product of research at Concordia University in Montreal Canada in the Ptidej Lab. If you want to use out tool, please cite the following paper:
For a complete list of works please visit my personal web site
There is a replication package of the experiments associated with the research paper where MoMIT approach was introduced: Replication package website
This project is licensed under the terms of the MIT - see the LICENSE file for details.
| Back | FazBrowse Home | New Git URL |