-
-
Notifications
You must be signed in to change notification settings - Fork 704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve performance #922
Merged
Improve performance #922
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Float clearance requires to calculate the line minimum width and height before setting the linebox position. When there are no floating boxes in the context, there's no need to calculate these sizes. We thus avoid a call to inline_min_content_width per text line. This call required a lot of time as it needed to go through the whole line breaking algorithm to render the first word. We save 15% of the rendering time when generating our Odyssey sample.
Spliting the line again is useless here.
As attributes of this object is accessed many times per element, it improves the overall speed in a significant way. We save between 1 and 2 percents with html5 sample for example.
Going through the whole specified properties dict can be long, and calling "startswith" on each name is even longer. Setting both computed and specified values at the same times avoids an extra loop in compute.
As this loop is called for each anonymous box, avoiding a text formatting makes a significant difference.
Setting text is slow and should be avoided when possible. We should probably avoid get_first_line too and keep the original one here.
This partially reverts a27146c.
It used to be really slow, at least on large inline containers.
It saves a lot of memory for very long paragraphs with no decoration style.
The device_size parameter was passed to many layout features, but it was only used to set default size of replaced boxes with no implicit or explicit size set. As this case is really rare for printed documents, and as it's also rare to have printed supports that small, we can remove this "feature". Moreover, in CSS3-images, another definition called "default object size" is used to set replaced box size when no size is defined. This size doesn't seem to be defined for images.
In the 2014 version of CSS Syntax Module Level 3 [1], meeting an EOF character before the end of a string would just return the string token. In the 2019 candidate recommendation [2], this behavior must raise a parse error. This commit fixes a test that was relying on the older behavior. TinyCSS2 will follow the new specification from version 1.1.0. [1] https://www.w3.org/TR/2014/CR-css-syntax-3-20140220/#consume-a-string-token [2] https://www.w3.org/TR/2019/CR-css-syntax-3-20190716/#consume-string-token
Add related tests too.
There used to be a problem with WRAP_CHAR method of Pango, but it's fixed. As nothing is said in Pango's Changelog, the probem may have been in our heads, and that wouldn't be surprising at all.
FakeHTML actually reads data from a file.
This TODO has been fixed with #771.
Related to #901.
Fix #917. One test fails with current 1.44.3 version, because of bug 397 [1] fixed in 1.44.4 (not released yet). [1] https://gitlab.gnome.org/GNOME/pango/issues/397
This reverts commit d6da699.
👍 for the cleanups |
We can now get style in the parent loop, avoiding a large number of calls to setdefault.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Also fix #700.