МETHOD FOR INCREASING THE PERFORMANCE OF A WEB APPLICATION IN THE REACT FRAMEWORK ECOSYSTEM
DOI:
https://doi.org/10.35546/kntu2078-4481.2023.3.12Keywords:
methods to improve performance of web applications, React framework ecosystem, React, Context API, PureComponent, React.memo, shouldComponentUpdate, Redux, Recoil, Lazy Loading, Code Splitting, memoization of selectors, concept of state managementAbstract
The article describes the available methods for improving the performance of a web application in the React framework ecosystem, their advantages and disadvantages, in particular, the use of React.memo, PureComponent, shouldComponentUpdate, Lazy Loading, Code Splitting and memoization of selectors. An optimized method is proposed, which allows to reduce the program execution time by an average of 17%. The main idea of the proposed method is to divide the state into atomic fragments. Each entity has its own state fragment that isolates it from others. These fragments are used by the React Context API to pass entity configuration, including data and functions to modify it. The Context API is used to provide stateful application-wide handling. The state is divided into atomic fragments, which allows their isolation. These fragments are accessed and modified using the hook function. Components that use this method automatically respond to state changes and are updated if the state has changed. The main advantage of this approach is the possibility of using the closing technology and transferring the function of state handlers. The proposed method is based on an approach that was borrowed from the Recoil library. This approach is similar to the standard hook functions in the React framework, for which the proposed method was developed. The advantages and disadvantages of using popular state management libraries in web applications were discussed. The goal of the modification was to avoid redundant operations when the current and new states are indistinguishable, to improve performance when adding large numbers of items, and to allow similar parts of the code to be used multiple times. Special attention is paid to the problem of redundant operations, which occurs when all components subscribed to a state change are automatically updated, even if the state values themselves have not changed. Added the ability to check the equality of states before updating them, which allows to save resources and preserve performance. Also implemented simplified handling of state change functions so that they can be used again without repeating code.
References
Pronina D., Kyrychenko I. (2022) Comparison of Redux and React Hooks Methods in Terms of Performance. COLINS-2022: 6th International Conference on Computational Linguistics and Intelligent Systems, May 12–13, Gliwice, Poland, pp. 3-7.
Shailesh Shivakumar, P.V. Suresh (2018) A Survey and Analysis of Techniques and Tools for Web Performance Optimization, Journal of Information Organization, Vol. 8, No. 2, pp. 31-57.
Chi, Xiaoni, Liu, Bichuan, Niu, Qi, Wu, Qiuxuan (2012) Web Load Balance and Cache Optimization Design Based Nginx under High-Concurrency Environment, Third International Conference on Digital Manufacturing & Automation, pp. 1029-1032.
Yanan Wang, Huarui Wu and Feng Huang (2014) High-performance concurrent Web application system analysis and research, Computer Engineering and Design Optimization, vol. 08, pp. 2976-2981.
Y. Yao and J. Xia (2016) Analysis and research on the performance optimization of Web application system in high concurrency environment, 2016 IEEE Information Technology, Networking, Electronic and Automation Control Conference, pp. 321-326, doi: 10.1109/ITNEC.2016.7560374.
Mohammed Zagane, Mustapha Kamel Abdi (2019) Evaluating and Comparing Size, Complexity and Coupling Metrics as Web Applications Vulnerabilities Predictors. International Journal of Information Technology and Computer Science (IJITCS), Vol.11, No.7, pp.35-42, DOI: 10.5815/ijitcs.2019.07.05
Ruqia Bibi, Munazza Jannisar, Mamoona Inayet (2016) Quality Implication for Prognoses Success in Web Applications. IJMECS, Vol.8, No.3, pp.37-44, DOI: 10.5815/ijmecs.2016.03.05
Oleshchenko, L., Burchak, P. (2023) Web Application State Management Performance Optimization Methods. In: Hu, Z., Dychka, I., He, M. (eds) Advances in Computer Science for Engineering and Education VI. ICCSEEA 2023. Lecture Notes on Data Engineering and Communications Technologies, vol. 181. Springer, Cham. https://doi.org/10.1007/978-3-031-36118-0_6