State management models impact on run-time performance in Single Page Applications

University essay from KTH/Skolan för elektroteknik och datavetenskap (EECS)

Author: Karl Fredrik Flovén; [2020]

Keywords: ;

Abstract: The choice of state management model, i.e. how the state is managed in an application, is an important part of application development. In this thesis, we investigate how run-time performance, more specifically scripting performance, is affected when managing a shared state using a relative state management model in comparison to using a global state management model, in a component-based Single Page Application. To compare the two state management models, two implementations of a simple application were made, with the same functionality, but managing application state in two different ways. Two experiments, each focusing on one application structure dimension, were done to compare the scripting performance of the implementations during state update. The results showed that the state management models do affect the scripting performance, but that it depends on the structure of the application. In the first experiment, the global state management model showed a much larger performance decrease in comparison to the relative state management model when increasing the amount of components dependent on the updating state. Observations of the reconciliation processes showed that the cause for the performance differences were due to unoptimized synchronous DOM mutations introduced by the components using the global state management framework. In the second experiment, the relative state management model showed a larger performance decrease for a deep component structure compared to the global state management model as the component tree depth increased, but in comparison to the previous experiment the difference was smaller. Taken together, the findings from this study suggests that scripting performance may be a factor to consider when choosing state management model for an application. However, the application structure, including the complexity of the application, impacts which state management model that is preferable and to what degree it affects the scripting performance, and thus the run-time performance.

  AT THIS PAGE YOU CAN DOWNLOAD THE WHOLE ESSAY. (follow the link to the next page)