filp / whoops

PHP errors for cool kids
http://filp.github.io/whoops/
MIT License
13.19k stars 604 forks source link

Speed up syntax highlighting #758

Closed garygreen closed 1 year ago

garygreen commented 1 year ago

This substantially reduces the time it takes to load a Whoops ever page, and time switching frame context.

Error page with 96 frames, tested with Laravel

Metric Before PR With PR Improvement
Page load time 1600ms 900ms +43%
Context switch time 4000ms 200ms +95%

This is because prior to this PR syntax highlighting occurs on page load, and every single click for the whole page and all frames, even those that aren't visible. This PR syntax highlights only frames that are visible.

😁

denis-sokolov commented 1 year ago

Thank you, this is an awesome thing to find! Also thank you for a clean PR with a good description!