Skip to main content

Small Footprint JavaScript Engine

  • Chapter
  • First Online:
Components and Services for IoT Platforms

Abstract

A key programming concept in the world of internet-of-things (IoT) is event-driven computation where events occurred in the ‘things’ are handled by their corresponding event handlers. JavaScript is particularly useful for this computational model due to its properties having event handlers simply programmable. Turning this model into a reality requires a compact, yet powerful JavaScript engine, which can be possibly working on a system equipped with scarce memory and limited CPU of the IoT devices. Although existing JavaScript engines widely being used in web browsers are powerful enough, they require a plenty amount of both static and runtime memory, which cannot fit in the small IoT devices. To handle this space issue, three small footprint JavaScript engines have been proposed previously: Espruino (http://www.espruino.com/), Quad-wheel (https://code.google.com/p/quad-wheel/), and Duktape (http://duktape.org/). This paper compares the three JavaScript engines by evaluating their binary size, runtime memory, and performance, as well as their compatibility of JavaScript tests. It has been found that, out of them, only Duktape correctly supports JavaScript features described in the current standard, yet with mediocre performance and memory requirement. This paper converts Duktape into a better performing one (which we call Duktape+) by applying six optimisations, including efficient property updates and lazy creation of built-in objects. Those optimisations result in as much as 30 % reduction of runtime memory usage and 30 % improvement of performance, with only 2 % increase of its binary size.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 109.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 139.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 139.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. L. Atzori, A. Iera, G. Morabito, The internet of things: A survey, International Journal of Computer and Telecommunications Networking, 54, 2787–2805 (2010)

    Google Scholar 

  2. S. Tilkov, S. Vinoski, Node.js: Using JavaScript to build high-performance network programs. IEEE Internet Comput. 14(6), 80–83 (2010)

    Article  Google Scholar 

  3. T.-M. Grønli, G. Ghinea, M. Younas, A lightweight architecture for the Web-of-Things. Mobile Web Information Systems (Springer, Berlin and Heidelberg, 2013), pp. 248–259

    Google Scholar 

  4. M. Kovatsch, M. Lanter, S. Duquennoy, Actinium: A restful runtime container for scriptable internet of things applications. 2012 3rd international conference on the internet of things (IOT), IEEE, 2012.

    Google Scholar 

  5. L. Tong et~al., Interactive surface composition based on arduino in multi-display environments. Proceedings of the ninth ACM international conference on interactive tabletops and surfaces, ACM, 2014.

    Google Scholar 

  6. ECMAScript, ECMA International, European Computer Manufacturers Association, ECMAScript Language Specification 5.1 Edition (2011), Accessible at http://www.ecma-international.org/ecma-262/5.1/Ecma-262.pdf

  7. R. Jones, R.D. Lins, Garbage Collection: Algorithms for Automatic Dynamic Memory Management (Wiley, New York, 1996)

    Google Scholar 

  8. J.R. Bell, Threaded code. Commun. ACM 16(6) (1973)

    Article  Google Scholar 

  9. C. Wootton, Beginning Samsung ARTIK. Apress (2016)

    Google Scholar 

Download references

Acknowledgments

This research was supported by the Ministry of Trade, Industry and Energy (MOTIE) through the Electronics and Telecommunications Research Institute (ETRI) (Project No. 10045344), Global PhD Fellowship Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education (NRF-2014H1A2A1019270), and Samsung Electronics.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Minsu Kim .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 Springer International Publishing Switzerland

About this chapter

Cite this chapter

Kim, M., Jeong, HJ., Moon, SM. (2017). Small Footprint JavaScript Engine. In: Keramidas, G., Voros, N., Hübner, M. (eds) Components and Services for IoT Platforms. Springer, Cham. https://doi.org/10.1007/978-3-319-42304-3_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-42304-3_6

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-42302-9

  • Online ISBN: 978-3-319-42304-3

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics