Skip to content

Commit

Permalink
warmup persistent cache twice to avoid store on second build
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Apr 27, 2021
1 parent 0a1b220 commit fea829e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ cases/**/yarn.lock
.pnp.js
/output
.gh-pages
*.cpuprofile
*.heapprofile
1 change: 1 addition & 0 deletions addons/persistent-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ if(!require("webpack").version.startsWith("4")) {
`;

export const keepBuildCache = true;
export const warmupTwice = true;
5 changes: 5 additions & 0 deletions lib/measure.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ export default async (caseName, scenarioAndAddons, options) => {
console.time(`${caseName} ${scenarioAndAddons} warmup`);
await scenario.warmup(options);
console.timeEnd(`${caseName} ${scenarioAndAddons} warmup`);
if (addons.some((addon) => addon.warmupTwice)) {
console.time(`${caseName} ${scenarioAndAddons} second warmup`);
await scenario.warmup(options);
console.timeEnd(`${caseName} ${scenarioAndAddons} second warmup`);
}

// measure
const results = [];
Expand Down

0 comments on commit fea829e

Please sign in to comment.