UI5 performance parameters data-sap-ui-preload vs. data-sap-ui-async
Data Structures & Algorithms practice on Codemia
Step through 300 algorithm problems with animated visualisers that show the data structure changing as the code runs.
Introduction
SAPUI5, often referred to as UI5, is a widely used JavaScript framework designed by SAP for building efficient, responsive, and accessible web-based applications. Performance optimization is critical for web applications, and in UI5, parameters like data-sap-ui-preload
and data-sap-ui-async
play crucial roles in enhancing performance. This article explores these parameters in depth, with technical explanations and examples for clarity.
Overview of UI5 Performance Parameters
data-sap-ui-preload
The data-sap-ui-preload
parameter is used to control the loading behavior of components and libraries in UI5. Its primary function is to enhance the initial load performance by reducing the number of HTTP requests necessary to load a UI5 application.
Key Values
- "async": Asynchronous loading of preloaded libraries. This is beneficial when you want a non-blocking load that allows the application to start user interaction while libraries are still being fetched.
- "sync": Synchronous loading, which ensures all resources are loaded before execution. This can prevent execution errors due to missing libraries but may cause delays in rendering.
- "auto": Automatically decides between synchronous and asynchronous loading based on device and browser capabilities.
Example:
- Reduced Initial Load Time: By deferring content not immediately needed, the application starts quicker.
- Improved User Experience: Users can begin interacting with the application while additional resources load in the background.
- Parallel Loading: Resources are fetched in parallel, optimizing bandwidth usage.
- Compatibility: Before using asynchronous parameters, ensure compatibility with the target browsers as older versions may exhibit issues.
- Resource Management: Proper implementation of async loading requires careful management of dependencies and resource initiation to avoid race conditions and errors like "resources are not available."
- Use "async" for data-sap-ui-preload in Conjunction with data-sap-ui-async: Ensures consistency and reduces risk of blocking.
- Monitor Application Performance: Use browser developer tools to track resource loading and identify bottlenecks.
- Environment Specific Strategies: Consider using different strategies based on the environment, for example, synchronous loading during development for faster debugging and logging.
Related reading
- UI lags during heavy computation operation in Flutter even with async
- UI still freezing when using async/await
- UIPopovercontroller dealloc reached while popover is still visible
- UIScrollView pauses NSTimer until scrolling finishes
- Unable to create new native thread error - but very few threads are in use
- Undefined reference to pthread_create in Linux
- Unable to simultaneously satisfy constraints, will attempt to recover by breaking constraint
- Unbalanced data and weighted cross entropy

DSA Fundamentals
Master algorithmic patterns and data structures through hands-on LeetCode-style problems - from arrays and hashing to dynamic programming and advanced graphs.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Data Structures & Algorithms practice on Codemia
Step through 300 algorithm problems with animated visualisers that show the data structure changing as the code runs.