Skip to content

Commit

Permalink
rm
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine committed Apr 1, 2024
1 parent 2c3afa1 commit 73d12b4
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions core/audits/dobetterweb/uses-http2.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import {Audit} from '../audit.js';
import {EntityClassification} from '../../computed/entity-classification.js';
import UrlUtils from '../../lib/url-utils.js';
import {LanternInteractive} from '../../computed/metrics/lantern-interactive.js';
import {NetworkRequest} from '../../lib/network-request.js';
import {NetworkRecords} from '../../computed/network-records.js';
import {LoadSimulator} from '../../computed/load-simulator.js';
Expand Down Expand Up @@ -116,32 +115,6 @@ class UsesHTTP2Audit extends Audit {
};
}

/**
* Computes the estimated effect all results being converted to use http/2, the max of:
*
* - end time of the last long task in the provided graph
* - end time of the last node in the graph
* @param {Array<{url: string}>} results
* @param {Node} graph
* @param {Simulator} simulator
* @return {number}
*/
static computeWasteWithTTIGraph(results, graph, simulator) {
const {savings: savingsOnOverallLoad, simulationBefore, simulationAfter} =
this.computeWasteWithGraph(results, graph, simulator, {
label: 'tti',
});

const savingsOnTTI =
LanternInteractive.getLastLongTaskEndTime(simulationBefore.nodeTimings) -
LanternInteractive.getLastLongTaskEndTime(simulationAfter.nodeTimings);

const savings = Math.max(savingsOnTTI, savingsOnOverallLoad);

// Round waste to nearest 10ms
return Math.round(Math.max(savings, 0) / 10) * 10;
}

/**
* Determines whether a network request is a "static resource" that would benefit from H2 multiplexing.
* XHRs, tracking pixels, etc generally don't benefit as much because they aren't requested en-masse
Expand Down

0 comments on commit 73d12b4

Please sign in to comment.