Is it bad to include a lot of files in PHP like it is for file based Sessions?

后端 未结 7 1009
遇见更好的自我
遇见更好的自我 2021-01-04 14:25

After reading about how file based PHP sessions are not the greatest for performance, it has me thinking. Does this mean a PHP script including a lot of files is bad as wel

7条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-04 14:53

    Like Chacha102 wrote, it isn't really that bad.

    But it also depends on your actual script files.

    In practice you should profile your code, Xdebug is great for this.

    To clarify: profile and compare. Avoid lots of small script files if you can, but still keep your source code organized (a single script with thousands of lines is not comfortable to edit). A profiler will give you some numbers to find a good balance.

提交回复
热议问题