Skip to content

Commit fd8f81f

Browse files
authored
Mixed benchmark fixups (#900)
* Mixed benchmarks: don't reshape on every iteration * Fixup just bench command
1 parent dd1574b commit fd8f81f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

benches/benches/mixed.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ impl CosmicTextContext {
1717
let mut buffer = Buffer::new_empty(metrics);
1818
buffer.set_size(font_system, None, None);
1919
buffer.set_text(font_system, text, attrs, Shaping::Advanced);
20+
buffer.shape_until_scroll(font_system, false);
2021
Self { buffer }
2122
}
2223

@@ -33,8 +34,6 @@ impl CosmicTextContext {
3334
});
3435
self.buffer.set_size(font_system, width_constraint, None);
3536

36-
self.buffer.shape_until_scroll(font_system, false);
37-
3837
let (width, total_lines) = self
3938
.buffer
4039
.layout_runs()

justfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import-yoga-tests:
77
format-fixtures:
88
cargo run --package format-fixtures --
99

10+
[working-directory: 'benches']
1011
bench *ARGS:
11-
cargo bench --package taffy_benchmarks {{ARGS}}
12+
cargo bench {{ARGS}}
1213

1314
clippy:
1415
cargo +nightly clippy --workspace

0 commit comments

Comments
 (0)