ProfileViewer: Convert the JSON samples into a more efficient format

Only do the conversion from JSON once. This makes it much faster to do
time range filtering with the timeline widget. :^)
This commit is contained in:
Andreas Kling 2019-12-15 17:26:54 +01:00
commit 063fef312e
Notes: sideshowbarker 2024-07-19 10:51:09 +09:00
3 changed files with 48 additions and 36 deletions

View file

@ -28,8 +28,8 @@ void ProfileTimelineWidget::paint_event(GPaintEvent& event)
float column_width = (float)frame_inner_rect().width() / (float)m_profile.length_in_ms();
for (auto& sample : m_profile.sample_data()) {
u64 t = sample.timestamp;
for (auto& sample : m_profile.samples()) {
u64 t = sample.timestamp - m_profile.first_timestamp();
int x = (int)((float)t * column_width);
int cw = max(1, (int)column_width);