iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
24.14k stars 1.12k forks source link

Perform benchmarks #7

Open hecrj opened 5 years ago

hecrj commented 5 years ago

As mentioned in #4, in order to avoid performance regressions, it would be great to run some benchmarks on the different parts of the API.

The most expensive operation is clearly UserInterface::build. This will be the main focus for many of the optimizations we will implement in the future. We should benchmark this first.

UserInterface::update and UserInterface::draw will also get slower the more widgets and events a user interface has to handle. It would be great to have some numbers!

tgotwig commented 5 years ago

I can try to have a look 🕵🔎

hecrj commented 5 years ago

@TGotwig Awesome! I really appreciate the help. Let me know if you need anything.

tgotwig commented 5 years ago

CPU is constantly on 3.x on MacOS when I run it with --release, although nothing is happening.

Aktivitätsanzeige (Meine Prozesse) 2019-09-14 14-47-26
lachlansneff commented 5 years ago

Looks to me like the event loop it's using is continuously polling.

hecrj commented 5 years ago

Yes, the example is drawing the UI every frame. This is expected.

Benchmarking the ggez example is not what this issue is about! iced is renderer-agnostic. We should benchmark iced.