Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with TBT per domain #2997

Open
christophe-ledu opened this issue Nov 3, 2023 · 0 comments
Open

Problem with TBT per domain #2997

christophe-ledu opened this issue Nov 3, 2023 · 0 comments
Labels
Type: Bug An issue or pull request relating to a bug in WebPageTest

Comments

@christophe-ledu
Copy link

christophe-ledu commented Nov 3, 2023

Description

The code merging blocking times (

WebPageTest/www/vitals.php

Lines 700 to 724 in 5dcc6b7

// Merge a start/end window into an existing array of times
function MergeBlockingTime(&$times, $start, $end)
{
$merged = false;
// See if it overlaps with an existing window
for ($i = 0; $i < count($times) && !$merged; $i++) {
$s = $times[0];
$e = $times[1];
if (
($start >= $s && $start <= $e) ||
($end >= $s && $end <= $e) ||
($s >= $start && $s <= $end) ||
($e >= $start && $e <= $end)
) {
$times[0] = min($start, $s);
$times[1] = max($end, $e);
$merged = true;
}
}
if (!$merged) {
$times[] = array($start, $end);
}
}
) seems to have missing [$i] in the lines 707, 708, 715, 716.

Steps to reproduce

The current code end up comparing number ($start and $end) with arrays ($s and $e), which does not seems to make any sense. Some values are never used (only using the first 2 arrays of $times).

In this section https://www.webpagetest.org/vitals.php?test=231103_AiDcHB_86B&run=1#tbt I get 9ms difference with cdn.digiteka.com

Expected result

I guess what is expected is $times[$i][0] and $times[$i][1]

Actual result

With overlapping tasks, some domains can get 9ms more blocking time.

Related issues?

Any related issues filed already? Haven't found any

@christophe-ledu christophe-ledu added the Type: Bug An issue or pull request relating to a bug in WebPageTest label Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug An issue or pull request relating to a bug in WebPageTest
Projects
None yet
Development

No branches or pull requests

1 participant