skip to main content
10.1145/3605098.3636068acmconferencesArticle/Chapter ViewAbstractPublication PagessacConference Proceedingsconference-collections
research-article

Elysia: Optimizing JavaScript Web Framework

Published: 21 May 2024 Publication History

Abstract

As JavaScript and its backend web frameworks garnered mainstream adoption and played a pivotal role in today's industry, challenges of runtime performance, developer experience, and type safety are potential hindrances to scaling and maintainability.
This paper suggests strategies for web frameworks in JavaScript to provide a balanced focus between performance and convenience by optimizing the performance of potentially expensive ergonomic features by utilizing JavaScript's interpreted nature and Just-In-Time compilation through the use of static analysis and dynamic code generation techniques in conjunction with adopting TypeScript's type system to provide an improved developer experience.
The reference implementation of the optimization strategies and design for developer experience is illustrated through the implementations in the Elysia JavaScript web framework, in which the performance is evaluated against non-optimized code and bench-marked against other real-world backend web frameworks.

References

[1]
Sabin Adams. 2022. End-To-End Type Safety: What, Why and How. https://sabinadams.hashnode.dev/end-to-end-type-safety-what-why-and-how
[2]
Tiago Brito, Mafalda Ferreira, Miguel Monteiro, Pedro Lopes, Miguel Barros, José Fragoso Santos, and Nuno Santos. 2023. Study of JavaScript Static Analysis Tools for Vulnerability Detection in Node.js Packages. http://arxiv.org/abs/2301.05097 arXiv:2301.05097 [cs].
[3]
Ethan Brown. 2019. Web development with node and express (2 ed.). O'Reilly Media, Sebastopol, CA.
[4]
Mathias Bynens. 2018. Celebrating 10 years of V8. https://v8.dev/blog/10-years
[5]
Boris Cherny. 2019. Programming TypeScript. O'Reilly Media, Sebastopol, CA.
[6]
Devographics. 2023. Stack Overflow Developer Survey 2023. https://survey.stackoverflow.co/2023
[7]
Fernando Doglio. 2020. Introducing Deno (1 ed.). APress, Berlin, Germany.
[8]
Dan Elphick. 2019. v8/src/execution/microtask-queue.h (@ec06bb6). https://source.chromium.org/chromium/chromium/src/+/main:v8/src/execution/microtask-queue.h;drc=ec06bb6ce5641cf65e400ec55b7421f87d04b999
[9]
Tech Empower. 2022. Web Framework Benchmarks Round 21. https://www.techempower.com/benchmarks/#section=data-r21
[10]
Tech Empower. 2023. Web Framework Benchmarks Round 22. https://www.techempower.com/benchmarks/#section=data-r22
[11]
Facebook. 2017. Prepack. https://www.netlify.com/blog/intro-to-serverless-functions/
[12]
Apache Software Foundation. 2023. Apache Thrift. https://thrift.apache.org
[13]
Zheng Gao, Christian Bird, and Earl T. Barr. 2017. To Type or Not to Type: Quantifying Detectable Bugs in JavaScript. In Proceedings of the 39th International Conference on Software Engineering (Buenos Aires, Argentina) (ICSE '17). IEEE Press, 758--769.
[14]
Google. 2023. Google Closure Compiler. https://github.com/google/closure-compiler?tab=readme-ov-file
[15]
Shu-yu Guo, Michael Ficarra, and Kevin Gibbons. 2023. ECMA-262, ECMAScript®2023 Language Specification (14 ed.). ECMA International. https://262.ecma-international.org/14.0/.
[16]
Roman Haas, Rainer Niedermayr, Tobias Roehm, and Sven Apel. 2020. Is Static Analysis Able to Identify Unnecessary Source Code? ACM Trans. Softw. Eng. Methodol. 29, 1, Article 6 (jan 2020), 23 pages.
[17]
Kasun Indrasiri and Danesh Kuruppu. 2020. GRPC: Up and running. O'Reilly Media, Sebastopol, CA.
[18]
Kongkeit Khunpanitchot. 2022. Elysia.js: Ergonomic Framework for Humans. https://github.com/elysiajs/elysia
[19]
Sebastian Kleinschmager, Romain Robbes, Andreas Stefik, Stefan Hanenberg, and Eric Tanter. 2012. Do static type systems improve the maintainability of software systems? An empirical study. In 2012 20th IEEE International Conference on Program Comprehension (ICPC). 153--162.
[20]
Donald E. Knuth. 1974. Computer Programming as an Art. Commun. ACM 17, 12 (dec 1974), 667--673.
[21]
Matthew C. Loring, Mark Marron, and Daan Leijen. 2017. Semantics of Asynchronous JavaScript. SIGPLAN Not. 52, 11 (oct 2017), 51--62.
[22]
Darrel Miller, Jeremy Whitlock, Marsh Gardiner, Mike Ralphson, Ron Ratovsky, and Uri Sarid. 2021. OpenAPI Specification v3.1.0. the Linux foundation. https://spec.openapis.org/oas/v3.1.0.
[23]
Donald R. Morrison. 1968. PATRICIA---Practical Algorithm To Retrieve Information Coded in Alphanumeric. J. ACM 15, 4 (oct 1968), 514--534.
[24]
Stack Overflow. 2023. State of JavaScript. https://stateofjs.com/en-US
[25]
Brittney Postma. 2022. Intro to Serverless Functions | Netlify. https://www.netlify.com/blog/intro-to-serverless-functions/
[26]
Antonio Quiña Mera, Pablo Fernandez, José María García, and Antonio Ruiz-Cortés. 2023. GraphQL: A Systematic Mapping Study. ACM Comput. Surv. 55, 10, Article 202 (feb 2023), 35 pages.
[27]
Leonard Richardson, Mike Amundsen, and Sam Ruby. 2013. Restful web APIs. O'Reilly Media.
[28]
Vlad Riscutia. 2019. Programming with types. Manning Publications, New York, NY.
[29]
sinclairzx81. 2023. TypeBox: Json Schema Type Builder with Static Type Resolution for TypeScript. https://github.com/sinclairzx81/typebox
[30]
Darko Stefanović, Danilo Nikolić, Dusanka Dakic, Ivana Spasojević, and Sonja Ristic. 2020. Static Code Analysis Tools: A Systematic Literature Review. 0565--0573.
[31]
Jarred Sumner. 2022. Bun. https://github.com/oven-sh/bun
[32]
TechEmpower. 2023. TechEmpower Framework Benchmarks. https://github.com/TechEmpower/FrameworkBenchmarks
[33]
Franky Tse. 2020. [NodeJS] Express source code --- Router, Route, Layer. [NodeJS] ExpresssourcecodeâĂŤRouter,Route,Layer
[34]
Malte Ubl. 2009. Ryan Dahl: Node.js, Evented I/O for V8 Javascript. https://www.jsconf.eu/2009/speaker/speakers_selected.html
[35]
Shiju Varghese. 2015. HTTP Middleware. In Web Development with Go. Apress, Berkeley, CA, 99--120.
[36]
Tomas Della Vedova. 2023. find-my-way: A crazy fast HTTP router. https://github.com/delvedor/find-my-way
[37]
Tomas Della Vedova. 2023. @hapi/call: Simple HTTP Router. https://github.com/hapijs/call
[38]
Web-interoperable Runtimes Community Group 2023. WinterCG Fetch Draft Community Group Report. Web-interoperable Runtimes Community Group. https://fetch.spec.wintercg.org/.
[39]
Allen Wirfs-Brock and Brendan Eich. 2020. JavaScript: The First 20 Years. Proc. ACM Program. Lang. 4, HOPL, Article 77 (jun 2020), 189 pages.
[40]
Nicholas C Zakas. 2010. High Performance JavaScript. O'Reilly Media, Sebastopol, CA.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
SAC '24: Proceedings of the 39th ACM/SIGAPP Symposium on Applied Computing
April 2024
1898 pages
ISBN:9798400702433
DOI:10.1145/3605098
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 21 May 2024

Check for updates

Author Tags

  1. javascript
  2. RESTful API
  3. static analysis
  4. optimization
  5. type safety

Qualifiers

  • Research-article

Conference

SAC '24
Sponsor:

Acceptance Rates

Overall Acceptance Rate 1,650 of 6,669 submissions, 25%

Upcoming Conference

SAC '25
The 40th ACM/SIGAPP Symposium on Applied Computing
March 31 - April 4, 2025
Catania , Italy

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 112
    Total Downloads
  • Downloads (Last 12 months)112
  • Downloads (Last 6 weeks)22
Reflects downloads up to 14 Jan 2025

Other Metrics

Citations

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media