Applet Page Rendering via onInit Pre-execution
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The existing applet page rendering technologies face delays in rendering due to the late triggering of the onLoad life cycle, which slows down the final rendering of page content and affects user experience, as the rendering thread must complete drawing and return results to the logical thread before executing onLoad.
Innovation Solution
The introduction of an initial incremental rendering phase using the onInit life cycle, where codes that do not depend on the first drawing result are pre-executed, allowing for separate execution from onLoad, thereby accelerating page loading and improving performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the onLoad life cycle is triggered after the rendering thread completes drawing and returns results to the logical thread, then the code execution is synchronized with rendering completion, but the page loading speed is significantly slowed down and user experience is affected
Solution Approach 1:
The patent introduces an onInit life cycle that executes code in advance before the rendering thread completes its drawing. This preliminary action allows non-dependent code to run ahead of time, eliminating the waiting period and accelerating page loading while maintaining proper synchronization for code that does depend on rendering results.
Solution Approach 2:
The patent segments the life cycle into distinct phases: onInit for preliminary code execution, onLoad for code dependent on rendering results, onShow for display, and onUnload for cleanup. This segmentation allows different types of code to execute at appropriate times, resolving the contradiction between early execution and rendering synchronization.
2Reliability
If codes are executed in the onLoad life cycle after rendering completion, then code execution is synchronized with page rendering, but the overall page performance is reduced due to sequential processing
Solution Approach 1:
The onInit life cycle performs preliminary actions by executing code that does not depend on rendering results before the rendering thread completes. This eliminates unnecessary waiting time for non-dependent code while preserving synchronization for code that requires rendering completion, thereby reducing total page rendering time.
Solution Approach 2:
The patent makes the code execution schedule dynamic by allowing onInit to execute before rendering completion and onLoad to execute after, adapting the execution timing to the specific needs of different code segments. This dynamic scheduling optimizes performance by parallelizing independent operations while maintaining proper sequencing for dependent operations.
Data Source
AI summary
Provided are a method and apparatus for applet page rendering, an electronic device and a storage medium. The method for applet page rendering includes steps described below. Original incremental rendering is performed on an applet page based on a pre-obtained first drawing result of the applet page to obtain an original incremental rendering result of the applet page. Rendering is performed on the applet page based on the pre-obtained first drawing result of the applet page, the original incremental rendering result of the applet page and a pre-obtained initial incremental rendering result of the applet page.


