1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

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
parent d4a570d576
commit 063fef312e
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);