Repository navigation
Conversation
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
This branch has not been deployed
This file contains hidden or 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
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.
Objective
Give the layout recursion a non-inlined boundary below the cache, at the algorithms themselves:
#[inline(never)]oncompute_flexbox_layout,compute_grid_layoutandcompute_block_layout.Without it, LLVM may inline an algorithm into the function that dispatches on display mode (each algorithm usually has a single call site per tree type). That function's frame is then reserved at the size of the largest inlined algorithm at every level of nesting, whichever algorithm the node actually uses. With fat LTO on
main,TaffyTree's dispatch closure has flexbox inlined into it (1728 B frame, vs 240 B in a default release build), so a chain of nested block containers pays for flexbox's frame at every level.Because the attribute is on the generic entry points, it applies to every tree implementation, not just
TaffyTree.No CHANGELOG entry: there is no API or behaviour change.
Context
Split out of the review of #1338, which puts the boundary above the cache (on
TaffyView::compute_child_layout). This PR does not include that change and is independent of it.All measurements are on e82f526, rustc 1.99, x86-64 Linux.
Stack per level of nesting (bytes, 1000-deep chain of one container type; deepest stack pointer seen in the leaf measure function, divided by the depth):
lto = "fat",codegen-units = 1lto = "fat",codegen-units = 1lto = "fat",codegen-units = 1In a default release build this is a no-op: LLVM already keeps the algorithms out of line.
Instructions vs main (callgrind, layout only):
Wall time vs main (Criterion,
target-cpu=x86-64-v2, 10 rounds interleaved per benchmark on one pinned core; min of rounds, then median of per-round ratios with its range; "spread" is max/min ofmainacross rounds):Default profile: within noise of
maineverywhere. Fat LTO: within noise exceptPanGUI/wide_wrappingandPanGUI/nested_vertical_stack, which are about 5% slower in every round. The fat LTO run was noisier than the default one (see the spread column), so its other rows are weaker evidence.Feedback wanted
Under fat LTO this is a trade rather than a pure win:
main, while block and grid chains use 18–26% less. Onmainflexbox is merged into the dispatch frame, so a flex level has one frame where this PR gives it two; I have not confirmed that this is the whole cause.Combined with #1338's attribute, the fat LTO stack numbers are 2561 / 3169 / 5121 (below
mainon all three chains), but that attribute costs 3–16% wall time on flex benchmarks in a default build.Link to Devin session: https://dioxus.staging.devinenterprise.com/sessions/259d4169660a4e578f212fee440f9eea
Open in Devin Desktop: https://dioxus.staging.devinenterprise.com/desktop/session/259d4169660a4e578f212fee440f9eea?variant=devin-insiders
Requested by: @nicoburns