Open nczyw opened 8 months ago
CPU usage is 100% when you just run basic Slint app with latest nightly version and Nodejs/Bunjs/Deno on Ubuntu.
CPU usage is 100% when you just run basic Slint app with latest nightly version and Nodejs/Bunjs/Deno on Ubuntu. Oh my god ,i originally planned to use slint instead of Qt to write industrial software, but it seems that it is not feasible yet.
@nczyw I've tried to run this app and it is not taking particularily lot of CPU.
Are you using in release or debug mode. Make sure you are running with --release
.
What renderer are you using? The default is the femtovg renderer, but you might want to try the skia renderer for better performance.
@ansarizafar That's probably another issue. Do you know what is causing it?
@ogoffart I don't what causing it but two CPU cores are constantly on 100%.
@nczyw I've tried to run this app and it is not taking particularily lot of CPU.
Are you using in release or debug mode. Make sure you are running with
--release
. What renderer are you using? The default is the femtovg renderer, but you might want to try the skia renderer for better performance.@ansarizafar That's probably another issue. Do you know what is causing it?
I'm using --release I'm very sorry, I just started using slint and don't know how to switch skia renderer.
This happens only when the button is clicked all the time. CPU usage is 0% when not clicking the button
Thank you for your report. Could you also show us the code that's invoked when you press the button, i.e. when the clicked
callback is invoked?
Thank you for your report. Could you also show us the code that's invoked when you press the button, i.e. when the
clicked
callback is invoked?
Ok. `fn main() { // let _handle = web_server(); println!("多线程异步web测试"); let app = App::new().unwrap(); let weak = app.as_weak(); app.on_clicked(move || { let app = weak.upgrade().unwrap(); app.set_counter(app.get_counter() + 2); }); app.run().unwrap(); }
slint::slint!{
import { Button , VerticalBox } from "std-widgets.slint";
export component App inherits Window {
in property
I have no idea what's going on on your machine. Would you be able to use a profiler to find out what's taking CPU?
slint::slint!{ import { Button , VerticalBox } from "std-widgets.slint"; export component App inherits Window { in property <int> counter:0; callback clicked <=> bb.clicked; VerticalBox { Text {text: "Hello world " + counter; font-size: 50px;} bb := Button { text: "按钮如何调整大小"; width: 500px; height: 500px; } } } }
The above is my testing code. Whenever I click the button, the CPU spikes to over 30%. Also, how to adjust the font size of the button?