1. nitine

    Hi Ozzy

    besides the ease, does this affect the performance too?

    1. Ozzy Rodriguez

      You may notice a difference on a super high traffic site, but for the most part, no. By super high traffic, I’m talking maybe a million page views a day.

      You should still separate them in development just to keep things neat, but you can have some sort of script that will compile everything into one file on upload.

      1. Jon Rivers

        Hey Ozzy,

        Thanks for the post. I know I’m a bit late, but wanted to add that perhaps performance wouldn’t be affected at all once the page cache and the server PHP cache had been sufficiently primed.

        At that point, I’ve always been under the assumption that the PHP work on the server’s end was done and that the server was just serving static html files. Since the require_once calls would only have to be executed a few times before the HTML files were compiled, I’m curious as to where you think the performance decline would occur.

        Maybe nitine was referring to a highly dynamic site (like an news site, social site, etc), where performance would be an issue. But I think for most sites with just a few templates and a daily update or so that not even traffic would be a factor that would affect performance in any way noticeable to browsing speed.

        Again, thanks for the post. I’m using it in my own themes now and want to hear your thoughts on the performance issue.

        1. Ozzy Rodriguez

          Thanks for the comment, Jon!

          I haven’t run enough tests to see if it makes a difference or not, but my thoughts were if there was any issue, it would be VERY minimal, at the most.

          I would definitely agree with you that, for most sites, there would be no performance impact.

          I’m glad you’re using this in your own themes and think more people should!

          1. Jon Rivers

            Thanks, Ozzy. Yes, I rambled on a lot about the performance thing and saw your note about the minimal performance. I think I was just double checking my own understanding to make sure you didn’t have some kind of knowledge that I had missed.

            I think I originally meant to add that I’m also finding this especially useful for keeping WooCommerce functions separate. If you’ve worked with it before, you probably remember how easy it is to start accumulating TONS of functions just to change columns numbers and the like.

            Anyway, thanks again.

Comments are closed.