mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Pass around Arc<Galley> to avoid copying a lot of data
This commit is contained in:
@@ -75,9 +75,12 @@ pub fn criterion_benchmark(c: &mut Criterion) {
|
||||
egui::FontDefinitions::default(),
|
||||
);
|
||||
let font = &fonts[text_style];
|
||||
c.bench_function("text layout", |b| {
|
||||
c.bench_function("text layout (uncached)", |b| {
|
||||
b.iter(|| font.layout_multiline(LOREM_IPSUM_LONG.to_owned(), wrap_width))
|
||||
});
|
||||
c.bench_function("text layout (cached)", |b| {
|
||||
b.iter(|| fonts.layout_multiline(text_style, LOREM_IPSUM_LONG.to_owned(), wrap_width))
|
||||
});
|
||||
|
||||
let galley = font.layout_multiline(LOREM_IPSUM_LONG.to_owned(), wrap_width);
|
||||
let mut tessellator = egui::epaint::Tessellator::from_options(Default::default());
|
||||
|
||||
Reference in New Issue
Block a user