Has XF 2.x gone too far?

Discussion in 'XenForo' started by hurricane_sh, Jun 18, 2019.

  1. hurricane_sh

    hurricane_sh Participant

    83
    13
    +15
    I'm in the process of migrating 5 vB forums to XF, only did one so far, the more I learn about XF, the more reluctant I want to proceed. No doubt XF 2 is much better than vB in many ways, mainly the integration with various social network sites which makes the registrations much easier, more intuitive user interface, excellent mobile experience.

    I can see XF 2 has tried to apply all kinds of new design framework or popular concept, but the forum has become too heavyweight, it's scary that the thread list page needs to include 175 php files, performance is no longer a concern. More customization will be done with addons, it not only makes it more troublesome, it also slows down the forum.

    I don't like the responsive design either, I wish I can customize the PC and mobile version separately.
     
  2. MagicalAzareal

    MagicalAzareal Magical Developer

    255
    70
    +115
    How many lines of code are those 175 php files? Splitting things up helps to make things more modular and easier to maintain.
     
    • Like Like x 1
    • Agree Agree x 1
    • List
  3. hurricane_sh

    hurricane_sh Participant

    83
    13
    +15
    I understand the concept, but there is a balance between performance and design.

    "Template modification" is new to me, I never used XF 1.x, don't know if it's already in XF 1. With "Template modification", any template changes can be done with addons, this will encourage addon development greatly, but tthere will be too many unnecessary addons.

    When I search how to customize forum titles with template edit, I found an add-on to do this job. It seems elegant and flexible, but in terms of performance it's just terrible. It's just a 5 minute manual edit job, now there will be an extra db query and one search&replace for every page view.

    Does XF 2 still have template hook like VB? Performance wise, hook is much better than "Template modification".
     
  4. Steve

    Steve Administrator

    3,629
    1,662
    +3,086
    You can with CSS media queries.

    No hooks in XF2. If something is increasing the db queries then it would be the modification itself regardless of it being a template modification or a hook. Template mods give you far better usefulness as they can be applied anywhere.
     
  5. hurricane_sh

    hurricane_sh Participant

    83
    13
    +15
    I didn't know that, thanks for the heads-up. :)
    Yes, you are right, that would be the biggest benefit. But any changes in the default template can break an addon, also when template mods overlap, there can be a problem.
     
    Last edited: Jun 19, 2019
  6. hurricane_sh

    hurricane_sh Participant

    83
    13
    +15
    Asked two simple questions on XF official forum, two days past, not a single reply. :(
     
  7. Jason5

    Jason5 Enthusiast

    228
    63
    +44
    Don't worry, ask the same question here you will get good replies
     
  8. mysiteguy

    mysiteguy Devotee

    2,860
    887
    +2,197
    The number of php files is largely irrelevant when it comes to performance since most servers are running opcache these days, so PHP files are not refetched and reparsed from disk with every load.
     
    • Informative! Informative! x 1
    • List
  9. palhanow

    palhanow Enthusiast

    104
    105
    +99
    XenForo in my experience is the most fast Forum software in the market.

    You shouldn't worry about.
     
    • Appreciation Appreciation x 1
    • List
  10. Xon

    Xon Adherent

    296
    177
    +427
    This is wrong, template modifications are compiling into a rendered template which is then cached by opcode caching and are much faster than hooks.
     
    • Informative! Informative! x 3
    • Like Like x 2
    • List
  11. Dubbed Navigator

    Dubbed Navigator Adherent

    252
    75
    +83
    Encouraging addon development is one of the main reasons I like XF in general. A good scope of basics in the core, leaving the admin to decide what they do and don't find valuable.
     
  12. Paul Buonopane

    Paul Buonopane Aspirant

    22
    83
    +17
    In recent years, PHP has changed direction. It is now a proper OOP language. Classes are usually divided into individual files. You should find that, despite including more files, performance is actually better. Older PHP applications were often impossible to optimize due to heavy use of constructs such as eval(); you should find that newer applications with more files perform significantly better on average. Just make sure you're using an up-to-date version of PHP 7.x with opcache enabled. If you're still on 5.x, you're going to see inferior performance with any application.

    From a programmer's perspective, the increase in file count does not mean the application is more bloated or heavyweight--it is a side effect of organizing logic and structure into classes.
     
    • Agree Agree x 3
    • Like Like x 1
    • List
  13. MagicalAzareal

    MagicalAzareal Magical Developer

    255
    70
    +115
    "OOP" was implemented in PHP over a decade ago.
    Use of eval has nothing to do with object oriented programming.

    Real template systems have also existed for over a decade.
    PHP5 is actually 30% faster than PHP7 on some benchmarks, curiously enough.
    This might be because of the tiny sizes of the programs however.
    Always a good idea.
     
  14. hurricane_sh

    hurricane_sh Participant

    83
    13
    +15
    XF 2 is really good, I like it more and more. :tup: I have converted 3 forums so far.

    However, it's not perfect in every way, I saw some addons that perform so simple tasks, it's absurd to use addons for those tasks. I wouldn't be surprised if some XF forums were stuck in 1.x because they installed dozens of addons.
     
    Last edited: Jul 4, 2019
  15. Paul Buonopane

    Paul Buonopane Aspirant

    22
    83
    +17
    While that's true, it's been slow to catch on, and it's really only come into full swing with PHP 7.x. The OO constructs were there in PHP 5.x, but adoption was limited, and there was still a lot of older functionality that didn't really have a more modern equivalent--error handling being a good example.

    While it doesn't per se, I think you'll find that PHP applications with a strong OO structure are a lot less likely to make heavy use of eval.

    That they have, and it's quite unfortunate that they're not more widely used. I don't know about XF 2.x, but 1.x relies on eval quite heavily for both templating and extension by add-ons.

    If you try hard enough, you can make benchmarks look like whatever you want. I've had to do some very rigorous profiling of different PHP engines/versions for work, and I found that, in general, for large applications, PHP 7.x with opcache could handle far more requests per second with lower request durations than PHP 5.x with opcache. (This was around the release of PHP 7.0, so it's probably gotten even better since then.) I found 7.x to be roughly on par with HHVM in terms of the number of significant requests it could handle without getting overloaded, but that HHVM did recover a bit faster from an overloaded state.
     
    • Agree Agree x 1
    • Informative! Informative! x 1
    • List
  16. Chris D

    Chris D XenForo Developer

    763
    952
    +1,735
    We removed usage of eval entirely in XF 2.0. The template system is our own creation rather than something “off the shelf” because it gave us more flexibility and control.
     
    • Like Like x 2
    • Winner Winner x 2
    • Informative! Informative! x 2
    • Agree Agree x 1
    • List
  17. mysiteguy

    mysiteguy Devotee

    2,860
    887
    +2,197
    I've seen on average about 15% better performance with 7.3 over 7.0. :)
     
  18. Paul Buonopane

    Paul Buonopane Aspirant

    22
    83
    +17
    It's definitely quite powerful. It took quite some time to reverse engineer and thoroughly document it on 1.x, though! I thought the container system was particularly clever.
     
  19. hurricane_sh

    hurricane_sh Participant

    83
    13
    +15
    I have almost finished customization, didn't use any unofficial addons. My members started liking xenForo, even on a forum which is targeting a group that absolutely hate changes.

    My favorite part of xenForo: {{ dump($var) }}, it makes everything easier, the output is beautiful.
    The worst part: in custom profile and thread fields, choice fields store IDs other than actual values in DB, it makes the choice field much less useful.
     
  20. hurricane_sh

    hurricane_sh Participant

    83
    13
    +15
    Too many spam registrations. XF anti-spam is very sophisticated, but missed some basics. The most effective way to fight spam is moderating new members' post with any links.
     
Verification:
Draft saved Draft deleted
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.