Skip to content
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

Update taffy requirement from 0.1.0 to 0.2.0 #6784

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Nov 28, 2022

Updates the requirements on taffy to permit the latest version.

Changelog

Sourced from taffy's changelog.

0.2.0

New features

Flexbox "gap" and AlignContent::SpaceEvenly

The gap property is now supported on flex containers. This can make it much easier to create even spacing or "gutters" between nodes.

Additionally we have a SpaceEvenly variant to the AlignContent enum to support evenly spaced justification in the cross axis (equivalent to align-content: space-evenly in CSS)

Debug module and cargo feature

Two debugging features have been added:

  • taffy::debug::print_tree(&Taffy, root) - This will print a debug representation of the computed layout of an entire node tree (starting at root), which can be useful for debugging layouts.

  • A cargo feature debug. This enabled debug logging of the layout computation process itself (this is probably mainly useful for those working taffy itself).

Performance improvements

A number of performance improvements have landed since taffy 0.1:

  • Firstly, our custom taffy::forest storage implementation was ripped out and replaced with a much simpler implementation using the slotmap crate. This led to performance increases of up to 90%.
  • Secondly, the caching implementation was improved by upping the number of cache slots from 2 to 4 and tweaking how computed results are allocated to chache slots to better match the actual usage patterns of the flexbox layout algorithm. This had a particularly dramatic effect on deep hierachies (which often involve recomputing the same results repeatedly), fixing the exponential blowup that was previously exhibited on these trees and improving performance by over 1000x in some cases!

Benchmarks vs. Taffy 0.1

Benchmark Taffy 0.1 Taffy 0.2 % change (0.1 -> 0.2)
wide/1_000 nodes (2-level hierarchy) 3.5458 µs 4.3571 µs +23.333%
wide/10_000 nodes (2-level hierarchy) 36.418 µs 42.967 µs +17.357%
wide/100_000 nodes (2-level hierarchy) 1.8275 ms 3.9096 ms +112.26%
deep/4000 nodes (12-level hierarchy)) 5.1845 s 15.318 µs -100.000%
deep/10_000 nodes (14-level hierarchy) 75.978 s 40.315 µs -100.000%
deep/100_000 nodes (17-level hierarchy) - 2.7644 ms -
deep/1_000_000 nodes (20-level hierarchy) - 1.2130 s -

(note that the table above contains multiple different units (milliseconds vs. microseconds vs. nanoseconds))

As you can see, we have actually regressed slightly in the "wide" benchmarks (where all nodes are siblings of a single parent node). Although it should be noted our results in these benchmarks are still very fast, especially on the 10,000 node benchmark which we consider to be the most realistic size where the result is measured in microseconds.

However, in the "deep" benchmarks we see dramatic improvements. The previous version of Taffy suffered from exponential blowup in the case of deeply nested hierachies. This has resulted in somewhat silly improvements like the 10,000 node (14-level) hierachy where Taffy 0.2 is a full 1 million times faster than Taffy 0.1. We've also included results with larger numbers of nodes (although you're unlikely to need that many) to demonstrate that this scalability continues up to even deeper levels of nesting.

Benchmarks vs. Yoga

Yoga benchmarks run via it's node.js bindings (the yoga-layout-prebuilt npm package), they were run a few times manually and it was verified that variance in the numbers of each run was minimal. It should be noted that this is using an old version of Yoga.

Benchmark Yoga Taffy 0.2
yoga/10 nodes (1-level hierarchy) 45.1670 µs 33.297 ns

... (truncated)

Commits
  • 664ce98 Don't specify explicit version for dev-dependencies (#258)
  • 2d58c51 WIP: User-friendly release notes for 0.2 (#249)
  • ca514f6 Rename Rect field start->left end->right (#257)
  • 82b3fc7 Improve working and correctness of doc-comment (#256)
  • b2046b1 Fix benchmark compilation + add super deep benchmarks (#255)
  • dfaec22 Change signature of mark_dirty method to match taffy 0.1 (#253)
  • 07a154d Fix calling set_measure on a node that didn't previously have a measure func ...
  • 49893a7 Rename FlexboxLayout back to Style (#251)
  • 9e53f03 Implement "gap" property for flexbox algorithm (#248)
  • ba4cd3c Layout algorithm decoupling, Sizing Constraints & Perf Improvements (#246)
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [taffy](https://github.com/DioxusLabs/taffy) to permit the latest version.
- [Release notes](https://github.com/DioxusLabs/taffy/releases)
- [Changelog](https://github.com/DioxusLabs/taffy/blob/main/RELEASES.md)
- [Commits](DioxusLabs/taffy@v0.1...v0.2)

---
updated-dependencies:
- dependency-name: taffy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the C-Dependencies A change to the crates that Bevy depends on label Nov 28, 2022
@mockersf
Copy link
Member

closed in favour of #6743

@mockersf mockersf closed this Nov 28, 2022
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Nov 28, 2022

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version. You can also ignore all major, minor, or patch releases for a dependency by adding an ignore condition with the desired update_types to your config file.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot bot deleted the dependabot/cargo/taffy-0.2.0 branch November 28, 2022 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Dependencies A change to the crates that Bevy depends on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant