How file size affect performance?

前端 未结 3 780
我寻月下人不归
我寻月下人不归 2021-01-20 05:13

I need some clarification on the performance of a website.

Assume server configuration is optimised and the same, just think about file size and number.

3条回答
  •  长发绾君心
    2021-01-20 05:34

    If you are only "using" 50 lines out of a 10,000 line file, then yes you are losing some performance... in both speed for the PHP to parse the whole page even though it isn't using 9,950 lines of it - as well as "developer-hell" where the development time to find this function and understand that the other mountain of code isn't relevant.

    That said, don't take a 10,000 line "utility" file, and split it into 500 separate files with 1 function in each of them... called randomly as needed (the opposite pain).

提交回复
热议问题