addEventListener('resize') with debounce + innerWidth VS matchMedia() + matchMedia.addListener() (version: 0)
This benchmark compares using `addEventListener('resize')` with window.innerWidth versus window.matchMedia with it's`addListener()` function to see which is faster.
Comparing performance of: matchMedia + addListener vs resize + innerWidth
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
matchMedia + addListener
resize + innerWidth
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
4 months ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36