Replies: 3 comments 1 reply
-
https://github.com/Vjze/Rust_demo; This is the code address, maybe someone can tell me why. |
Beta Was this translation helpful? Give feedback.
-
Edit: Retracting this for now. I rewrote my test code to just create 10k rows without any of my database stuff and it works fine, so I think something else is happening. I'll update this when I am sure. I am seeing this same problem on Slint 1.3.0 on macOS as well. I'm loading about 900 rows into a StandardTableView and the second time I set the model (not the first) it goes to 100% CPU and locks the UI. Here is the code that sets the model:
And here is the Slint code:
And terminal output:
After the second "set page" the UI locks up with spinning beach ball. I peeked around in the debugger a bit and got a "feeling" that it had something to do with unregistering event handlers or bindings or something like that, deep in the Slint code. I'd appreciate any thoughts or ideas anyone has. This is a show stopper for me. Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hi, I'd like to revisit this. I'm still experiencing the issue, and I've narrowed it down and have produced a stand alone test case, which is attached. In short, when scrolling the StandardTableView quickly, there are huge spikes in CPU and the frame rate drops to 0. This is happening even in a simple table with 100 rows of 6 text columns, which is demonstrated in the attached app. If you bump it up to 1000 rows you start getting complete UI lockups with Mac beach balls, and 10k rows is unusable. I'm on an M1 Mac with 16 GB of RAM. The attached sample project is a clone of https://github.com/slint-ui/slint-rust-template with the following slint and Rust code:
import { Button, VerticalBox, StandardTableView } from "std-widgets.slint";
export component AppWindow inherits Window {
in-out property <[[StandardListViewItem]]> rows;
VerticalBox {
StandardTableView {
height: 100%;
width: 100%;
columns: [
{ title: "Title" },
{ title: "Album" },
{ title: "Artist" },
{ title: "Track #" },
{ title: "Plays" },
{ title: "Length" },
];
rows: rows;
}
Text {
horizontal-alignment: right;
text: rows.length + " items";
}
}
} |
Beta Was this translation helpful? Give feedback.
-
I tested two demos, one uses struct to customize the display information, and the other uses StandardTableView to display the information. StandardTableView will freeze after a few clicks to query, but the customized display will not freeze no matter how many times it is clicked. What is the reason? My English is not good, please forgive me.
Beta Was this translation helpful? Give feedback.
All reactions