Skip to content

perf(css): Introduce CSS validation cache#474

Open
PHPGangsta wants to merge 1 commit intoezyang:masterfrom
PHPGangsta:css-cache
Open

perf(css): Introduce CSS validation cache#474
PHPGangsta wants to merge 1 commit intoezyang:masterfrom
PHPGangsta:css-cache

Conversation

@PHPGangsta
Copy link
Contributor

This change delivers a significant performance improvement. I benchmarked 30 HTML fixtures ranging from 600 bytes to 1.5 MB, and the overall runtime dropped by ~30% on average.

@PHPGangsta
Copy link
Contributor Author

Here my performance comparison (time columns in seconds):

Filename Size v4.19.0 v4.19.0 % improvement
file_1.html 16.79 KB 0.012074 0.009871 18.25%
file_2.html 174.69 KB 0.052382 0.044274 15.48%
file_3.html 1.55 MB 0.030671 0.024884 18.87%
file_4.html 223.8 KB 0.110211 0.096668 12.29%
file_5.html 220.73 KB 0.214735 0.205500 4.30%
file_6.html 1.78 KB 0.003513 0.003002 14.55%
file_7.html 677 B 0.002160 0.001467 32.08%
file_8.html 807.24 KB 0.517928 0.198742 61.63%
file_9.html 63.85 KB 0.024996 0.023156 7.36%
file_10.html 69.78 KB 0.040163 0.033159 17.44%
file_11.html 16.19 KB 0.008988 0.006415 28.63%
file_12.html 33.53 KB 0.027129 0.026988 0.52%
file_13.html 1.35 KB 0.001827 0.001761 3.61%
file_14.html 254.43 KB 0.082556 0.074510 9.75%
file_15.html 1.31 MB 0.556819 0.508497 8.68%
file_16.html 2.35 KB 0.002718 0.001942 28.55%
file_17.html 1.83 KB 0.002005 0.001303 35.02%
file_18.html 1.92 KB 0.002295 0.002173 5.32%
file_19.html 4.21 KB 0.016169 0.011155 31.01%
file_20.html 2.03 KB 0.001159 0.001132 2.32%
file_21.html 1.85 KB 0.001468 0.001477 -0.62%
file_22.html 2.14 KB 0.096445 0.090994 5.65%
file_23.html 8.73 MB 3.806175 2.608822 31.46%
file_24.html 6.91 MB 3.560399 2.392689 32.80%
file_25.html 27.22 MB 15.081169 9.677023 35.83%
file_26.html 15.43 KB 0.012349 0.012214 1.09%
file_27.html 3.35 KB 0.001129 0.000951 15.76%
file_28.html 38.21 KB 0.029521 0.031496 -6.69%
file_29.html 685.83 KB 0.417299 0.184710 55.74%
file_30.html 885.84 KB 0.598710 0.223569 62.66%

Summary stats

v4.19.0 v4.19.0 % improvement
Memory Usage 727 MB 733.69 MB
Memory Real Usage 797.23 MB 799.67 MB
Seconds 25.361588 16.553331 34.73%

PHP Version: 8.1.34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant