Improve performance of placeholder and add ghs performance test #17725
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Suggested merge commit message (convention)
Other (engine): Improve performance of the placeholders.
Other (image): Attribute
loading="lazy"
will be automatically added in editing view to images withheight
andwidth
attributes set to improve loading performance.Tests: Added new
ghs
manual performance test.MINOR BREAKING CHANGE (image): Starting from this release, images that have
height
andwidth
attributes set will automatically receiveloading="lazy"
attribute in the editing area. This happens only for the content loaded into the editor, the data output produced by the editor remains the same. The reason for this change is to improve user experience in documents that may contain hundreds of images.This is a continuation of #17589.
When looking at the numbers reported by the performance tests, we can see that these changes have reduced the load time of the
ghs
test by around 23% (from 9400ms to 7300ms).However, when images were present in the document, a lot of code was run after they were loaded, so the browser window was still frozen for a few seconds after the editor was rendered. When this is considered, the performance is now 2 times better (loading, scripting, rendering, and painting took 17800ms before, but only 8900 ms after, including devtools overhead).