Bug 1577905 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

I'm not sure why the sitespeed.io documentation says ["testing the same site multiple times will break"](https://www.sitespeed.io/documentation/sitespeed.io/scripting/).

I had started off with the dummy url method but I'm sure it does break Necko caching and it does indeed produce a differently-shaped `browsertime.json` which isn't great.

So I went to a method that's closer to what Denis was using:
(Transcribed here with the automation variables)

```
module.exports = async function(context, commands) {
    let url = context.options.perftest.url;
    let reloads = context.options.perftest.reloads;
    
    await commands.navigate('https://www.example.com');
    await commands.wait.byTime(30000); // magic number
    
    // Initial cold load and wait
    await commands.navigate(url);
    await commands.wait.byTime(10000); // magic number

    // Warm loads
    for (let count = 0; count < reloads; count++) {
        await commands.wait.byTime(3000);  // magic number
        await commands.measure.start(url);
    }
    return true;
};
```

This one is throwing away the results of the cold load.


The `browsertime.json` shape is identical to the cold load, so the `process.py` and R scripts all work out of the box.
I'm not sure why the sitespeed.io documentation says ["testing the same site multiple times will break"](https://www.sitespeed.io/documentation/sitespeed.io/scripting/).

I had started off with the dummy url method but I'm sure it does break Necko caching and it does indeed produce a differently-shaped `browsertime.json` which isn't great.

So I went to a method that's closer to what Denis was using:
(Transcribed here with the automation variables)

```javascript
module.exports = async function(context, commands) {
    let url = context.options.perftest.url;
    let reloads = context.options.perftest.reloads;
    
    await commands.navigate('https://www.example.com');
    await commands.wait.byTime(30000); // magic number
    
    // Initial cold load and wait
    await commands.navigate(url);
    await commands.wait.byTime(10000); // magic number

    // Warm loads
    for (let count = 0; count < reloads; count++) {
        await commands.wait.byTime(3000);  // magic number
        await commands.measure.start(url);
    }
    return true;
};
```

This one is throwing away the results of the cold load.


The `browsertime.json` shape is identical to the cold load, so the `process.py` and R scripts all work out of the box.

Back to Bug 1577905 Comment 3