How to do performance debugging? #698
-
I'm trying to understand why my application runs so incredibly slow. I did some stack sampling but don't get quite far: ![]() (This is speedscope and here's the sample.) I'm looking at potentially really large tables, like this one: ![]() I think the functional reactive UI makes it hard to narrow this down to a root cause. I have several hunches, of course, but I cannot validate them one-by-one efficiently. For example, the columns (with potentially 10k elements each) are being added like this: Elements body;
body.reserve(slice.rows());
for (size_t row = 0; row < slice.rows(); ++row) {
auto cell = StaticCell(slice.at(row, col), state_->theme);
body.push_back(std::move(cell));
}
body_->Add(lift(vbox(std::move(body)))); I can only guess that this is somewhere visible on the flame graph. How do you do performance debugging? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
It looks like it spent time trying to determine the size of string. Then I would try to limit the amount of lines rendered inside the table. Most of it won't be shown, so there are no need to do the layout for 10k elements. |
Beta Was this translation helpful? Give feedback.
It looks like it spent time trying to determine the size of string.
Could you check if #691 fixed the issue?
Then I would try to limit the amount of lines rendered inside the table. Most of it won't be shown, so there are no need to do the layout for 10k elements.
I see you took a
slice
, so that's probably what you are already doing.