Has XF 2.x gone too far?

hurricane_sh

Enthusiast
Joined
Jun 25, 2009
Messages
117
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.
 

MagicalAzareal

Magical Developer
Joined
Apr 25, 2019
Messages
559
How many lines of code are those 175 php files? Splitting things up helps to make things more modular and easier to maintain.
 

hurricane_sh

Enthusiast
Joined
Jun 25, 2009
Messages
117
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".
 

Steve

Fanatic
Joined
Apr 17, 2009
Messages
3,743
I wish I can customize the PC and mobile version separately.
You can with CSS media queries.

Does XF 2 still have template hook like VB? Performance wise, hook is much better than "Template modification"
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.
 

hurricane_sh

Enthusiast
Joined
Jun 25, 2009
Messages
117
You can with CSS media queries.
I didn't know that, thanks for the heads-up. :)
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.
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:

hurricane_sh

Enthusiast
Joined
Jun 25, 2009
Messages
117
Asked two simple questions on XF official forum, two days past, not a single reply. :(
 

Jason5

Adherent
Joined
Jun 18, 2013
Messages
277
Don't worry, ask the same question here you will get good replies
 

mysiteguy

Fanatic
Joined
Feb 20, 2007
Messages
3,016
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.
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.
 

palhanow

Enthusiast
Joined
Jun 23, 2016
Messages
138
XenForo in my experience is the most fast Forum software in the market.

You shouldn't worry about.
 

Dubbed Navigator

Adherent
Joined
Jul 22, 2014
Messages
303
"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.

.
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.
 

Paul Buonopane

Aspirant
Joined
Jan 17, 2015
Messages
28
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.
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.
 

MagicalAzareal

Magical Developer
Joined
Apr 25, 2019
Messages
559
In recent years, PHP has changed direction. It is now a proper OOP language.
"OOP" was implemented in PHP over a decade ago.
constructs such as eval();
Use of eval has nothing to do with object oriented programming.

Real template systems have also existed for over a decade.
If you're still on 5.x, you're going to see inferior performance with any application.
PHP5 is actually 30% faster than PHP7 on some benchmarks, curiously enough.
This might be because of the tiny sizes of the programs however.
Just make sure you're using an up-to-date version of PHP 7.x with opcache enabled.
Always a good idea.
 

hurricane_sh

Enthusiast
Joined
Jun 25, 2009
Messages
117
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:

Paul Buonopane

Aspirant
Joined
Jan 17, 2015
Messages
28
"OOP" was implemented in PHP over a decade ago.
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.

Use of eval has nothing to do with object oriented programming.
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.

Real template systems have also existed for over a decade.
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.

PHP5 is actually 30% faster than PHP7 on some benchmarks, curiously enough.
This might be because of the tiny sizes of the programs however.
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.
 

Chris D

XenForo Developer
Joined
Aug 23, 2012
Messages
785
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.
 

mysiteguy

Fanatic
Joined
Feb 20, 2007
Messages
3,016
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.
I've seen on average about 15% better performance with 7.3 over 7.0. :)
 

Paul Buonopane

Aspirant
Joined
Jan 17, 2015
Messages
28
The template system is our own creation rather than something “off the shelf” because it gave us more flexibility and control.
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.
 

hurricane_sh

Enthusiast
Joined
Jun 25, 2009
Messages
117
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.
 

hurricane_sh

Enthusiast
Joined
Jun 25, 2009
Messages
117
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.
 
Top