firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.25k stars 199 forks source link

First test runs slower than the rest #2275

Closed Ezbaze closed 4 months ago

Ezbaze commented 4 months ago

Bug Description

The first test consistantly runs slower than the rest, even if the next one is exactly the same. image

Reproduction steps

First 2 tests in here but the expresion doesn't matter as long as it's slow enough to see the diffrence in time.

Expected Outcome

First test should have similar time to one that isn't first :)

Browser

Chrome - Version 124.0.6367.119 (Official Build) (64-bit)

OS

Windows 11

firasdib commented 4 months ago

This is a side effect that can't be worked around, since the first test also "initializes" and warms up the engine. The subsequent tests don't have to worry about this.

For what it's worth, the time is not super relevant or something you should put too much weight into. If you see one test deviating by a lot, then that's worth investigating.