JavaScript Sealed Classes - Archive ouverte HAL Accéder directement au contenu
Communication Dans Un Congrès Année : 2022

JavaScript Sealed Classes

Manuel Serrano

Résumé

In this work, we study the JavaScript sealed classes, which differ from regular classes in a few constraints that allow ahead-of-time (aot) compilers to implement them more efficiently. Sealed classes are compatible with the rest of the language so that they can be combined with all other JS structures, including regular classes, and can be gradually integrated into existing code bases. We present the design of the sealed classes and study their implementation in the hopc aot compiler. We present an in-depth analysis of the speed of sealed classes compared to regular classes. Do do so, we assembled a new suite of benchmarks that focuses on the efficiency of class implementations. On this suite, we measured that sealed classes provide an average speedup of 19%. The more classes and methods the programs use, the greater the speedup. For the most favorable test that uses them intensively, we measured a speedup of 56%.
Fichier non déposé

Dates et versions

hal-03920356 , version 1 (03-01-2023)

Identifiants

  • HAL Id : hal-03920356 , version 1

Citer

Manuel Serrano. JavaScript Sealed Classes. ECOOP 2022 - 36th European Conference on Object-Oriented Programming, Jun 2022, Berlin, Germany. ⟨hal-03920356⟩
53 Consultations
0 Téléchargements

Partager

Gmail Facebook X LinkedIn More