bevy/crates/bevy_ui
James Liu 7a176ae0a8 Optimize color computation in prepare_uinodes (#7311)
# Objective
Speed up `prepare_uinodes`. The color `[f32; 4]` is being computed separately for every vertex in the UI, even though the color is the same for all 6 verticies.

## Solution
Avoid recomputing the color and cache it for all 6 verticies.

## Performance
On `many_buttons`, this shaved off 33% of the time in `prepare_uinodes` (7.67ms -> 5.09ms) on my local machine.
![image](https://user-images.githubusercontent.com/3137680/213862448-236ac6e4-040a-4c86-a801-b947d99cc581.png)
2023-01-22 06:51:31 +00:00
..
src Optimize color computation in prepare_uinodes (#7311) 2023-01-22 06:51:31 +00:00
Cargo.toml Upgrade to Taffy 0.2 (#6743) 2022-12-21 02:15:53 +00:00