Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Improving Sequential Performance of Erlang Based on a Meta-tracing Just-In-Time Compiler

  • Conference paper
  • First Online:
Trends in Functional Programming (TFP 2016)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 10447))

Included in the following conference series:

  • 315 Accesses

Abstract

In widely-used actor-based programming languages, such as Erlang, sequential execution performance is as important as scalability of concurrency. In order to improve sequential performance of Erlang, we develop Pyrlang, an Erlang virtual machine with a just-in-time (JIT) compiler by applying an existing meta-tracing JIT compiler. In this paper, we overview our implementation and present the optimization techniques for Erlang programs, most of which heavily rely on function recursion. Our preliminary evaluation showed approximately 38% speedup over the standard Erlang interpreter.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight 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

Notes

  1. 1.

    https://github.com/ninenines/cowboy.

  2. 2.

    https://github.com/ChicagoBoss/ChicagoBoss.

  3. 3.

    https://github.com/mochi/mochiweb.

  4. 4.

    According to the Computer Language Benchmarks Game (http://benchmarksgame.alioth.debian.org/), BEAM is slower than C by the factors of 4–95 with 10 benchmark programs.

  5. 5.

    Though HiPE is known to exhibit largely different performance improvements depending on the types of application programs [12], it speeds up by the factors from 1.8 to 3.5 according to the benchmark results in a literature [15] and our experiments.

  6. 6.

    Other than BEAM and HiPE, there are a few attempts to support JIT compilation for Erlang, which we discuss in the later section of the paper.

  7. 7.

    https://pypy.readthedocs.org/en/release-2.4.x/jit/virtualizable.html.

  8. 8.

    https://github.com/pnkfelix/larceny-pnk/tree/master/test/Benchmarking/CrossPlatform/src.

  9. 9.

    https://github.com/cstavr/erllvm-bench/tree/master/src.

  10. 10.

    According to the data from http://speed.pypy.org.

References

  1. Agha, G.: Actors: A Model of Concurrent Computation in Distributed Systems. MIT Press, Cambridge (1986)

    Google Scholar 

  2. Armstrong, J.: Erlang: a survey of the language and its industrial applications. In: Proceedings of the Symposium on Industrial Applications of Prolog, INAP 1996, pp. 16–18 (1996)

    Google Scholar 

  3. Armstrong, J.: The development of Erlang. In: Proceedings of International Conference on Functional Programming 1997, pp. 196–203. ACM (1997)

    Google Scholar 

  4. Armstrong, J.L., Virding, S.R.: Erlang: an experimental telephony programming language. In: Proceedings of XIII International Switching Symposium, pp. 43–48 (1980)

    Google Scholar 

  5. Bolz, C.F., Cuni, A., Fijalkowski, M., Rigo, A.: Tracing the meta-level: PyPy’s tracing JIT compiler. In: Proceedings of the 4th workshop on the Implementation, Compilation, Optimization of Object-Oriented Languages and Programming Systems, pp. 18–25. ACM (2009)

    Google Scholar 

  6. Bolz, C.F., Pape, T., Siek, J., Tobin-Hochstadt, S.: Meta-tracing makes a fast Racket. In: Proceedings of Workshop on Dynamic Languages and Applications (2014)

    Google Scholar 

  7. Bolz, C.F., Tratt, L.: The impact of meta-tracing on VM design and implementation. Sci. Comput. Program. 98, 408–421 (2015)

    Article  Google Scholar 

  8. Drejhammar, F., Rasmusson, L.: BEAMJIT: a just-in-time compiling runtime for Erlang. In: Proceedings of the Thirteenth ACM SIGPLAN Workshop on Erlang, pp. 61–72. ACM (2014)

    Google Scholar 

  9. Hausman, B.: The Erlang BEAM virtual machine specification. http://www.cs-lab.org/historical_beam_instruction_set.html, October 1997. Rev. 1.2

  10. Hayashizaki, H., Wu, P., Inoue, H., Serrano, M.J., Nakatani, T.: Improving the performance of trace-based systems by false loop filtering. In: Proceedings of the Sixteenth International Conference on Architectural Support for Programming Languages and Operating Systems, pp. 405–418. ACM (2012)

    Google Scholar 

  11. Homescu, A., Şuhan, A.: HappyJIT: a tracing JIT compiler for PHP. In: Proceedings of the 7th Symposium on Dynamic Languages, pp. 25–36. ACM (2011)

    Google Scholar 

  12. Johansson, E., Nyström, S.-O., Lindgren, T., Jonsson, C.: Evaluation of HiPE, an Erlang native code compiler. Technical report, 99/03, Uppsala University ASTEC (1999)

    Google Scholar 

  13. Johansson, E., Nyström, S.-O., Pettersson, M., Sagonas, K.: HiPE: High performance Erlang. Technical Report ASTEC 99/04, Uppsala University (1999)

    Google Scholar 

  14. Li, K., Hudak, P.: A new list compaction method. Softw. Pract. Exp. 16(2), 145–163 (1986)

    Article  Google Scholar 

  15. Pettersson, M., Sagonas, K., Johansson, E.: The HiPE/x86 Erlang compiler: system description and performance evaluation. In: Hu, Z., Rodríguez-Artalejo, M. (eds.) FLOPS 2002. LNCS, vol. 2441, pp. 228–244. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45788-7_14

    Chapter  MATH  Google Scholar 

  16. Sagonas, K., Pettersson, M., Carlsson, R., Gustafsson, P., Lindahl, T.: All you wanted to know about the HiPE compiler: (but might have been afraid to ask). In: Proceedings of the Third ACM SIGPLAN Workshop on Erlang, pp. 36–42. ACM (2003)

    Google Scholar 

  17. Sagonas, K., Stavrakakis, C., Tsiouris, Y.: ErLLVM: an LLVM backend for Erlang. In: Proceedings of the Eleventh ACM SIGPLAN Workshop on Erlang Workshop, pp. 21–32. ACM (2012)

    Google Scholar 

  18. Shao, Z., Reppy, J.H., Appel, A.W.: Unrolling lists. In: Proceedings of the ACM Conference on Lisp and Functional Programming, pp. 185–195 (1994)

    Google Scholar 

  19. Thomassen, E.W.: Trace-based just-in-time compiler for Haskell with RPython. Master’s thesis, Norwegian University of Science and Technology Trondheim (2013)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Hidehiko Masuhara .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Huang, R., Masuhara, H., Aotani, T. (2019). Improving Sequential Performance of Erlang Based on a Meta-tracing Just-In-Time Compiler. In: Van Horn, D., Hughes, J. (eds) Trends in Functional Programming. TFP 2016. Lecture Notes in Computer Science(), vol 10447. Springer, Cham. https://doi.org/10.1007/978-3-030-14805-8_3

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-14805-8_3

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-14804-1

  • Online ISBN: 978-3-030-14805-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics