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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
- 2.
- 3.
- 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.
- 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.
- 8.
- 9.
- 10.
According to the data from http://speed.pypy.org.
References
Agha, G.: Actors: A Model of Concurrent Computation in Distributed Systems. MIT Press, Cambridge (1986)
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)
Armstrong, J.: The development of Erlang. In: Proceedings of International Conference on Functional Programming 1997, pp. 196–203. ACM (1997)
Armstrong, J.L., Virding, S.R.: Erlang: an experimental telephony programming language. In: Proceedings of XIII International Switching Symposium, pp. 43–48 (1980)
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)
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)
Bolz, C.F., Tratt, L.: The impact of meta-tracing on VM design and implementation. Sci. Comput. Program. 98, 408–421 (2015)
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)
Hausman, B.: The Erlang BEAM virtual machine specification. http://www.cs-lab.org/historical_beam_instruction_set.html, October 1997. Rev. 1.2
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)
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)
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)
Johansson, E., Nyström, S.-O., Pettersson, M., Sagonas, K.: HiPE: High performance Erlang. Technical Report ASTEC 99/04, Uppsala University (1999)
Li, K., Hudak, P.: A new list compaction method. Softw. Pract. Exp. 16(2), 145–163 (1986)
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
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)
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)
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)
Thomassen, E.W.: Trace-based just-in-time compiler for Haskell with RPython. Master’s thesis, Norwegian University of Science and Technology Trondheim (2013)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
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)