mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -04:00
Add a realistic end-to-end benchmark
This commit is contained in:
@@ -9,7 +9,17 @@ pub fn criterion_benchmark(c: &mut Criterion) {
|
|||||||
let mut ctx = egui::CtxRef::default();
|
let mut ctx = egui::CtxRef::default();
|
||||||
let mut demo_windows = egui_demo_lib::DemoWindows::default();
|
let mut demo_windows = egui_demo_lib::DemoWindows::default();
|
||||||
|
|
||||||
c.bench_function("demo_windows_minimal", |b| {
|
// The most end-to-end benchmark.
|
||||||
|
c.bench_function("demo_windows_minimal with tesselation (realistic)", |b| {
|
||||||
|
b.iter(|| {
|
||||||
|
ctx.begin_frame(raw_input.clone());
|
||||||
|
demo_windows.ui(&ctx);
|
||||||
|
let (_, shapes) = ctx.end_frame();
|
||||||
|
ctx.tessellate(shapes)
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
c.bench_function("demo_windows_minimal (no tesselation)", |b| {
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
ctx.begin_frame(raw_input.clone());
|
ctx.begin_frame(raw_input.clone());
|
||||||
demo_windows.ui(&ctx);
|
demo_windows.ui(&ctx);
|
||||||
|
|||||||
Reference in New Issue
Block a user