vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   vBulletin 4 & PHP 7 - drastic speed improvement! (https://vborg.vbsupport.ru/showthread.php?t=320975)

Dave 12-04-2015 06:25 PM

vBulletin 4 & PHP 7 - drastic speed improvement!
 
Refer to my blog post in case you want to make vBulletin 4 work on PHP 7 as well:
https://blog.technidev.com/vbulletin...aking-it-work/

-----

http://www.zend.com/en/resources/php...ow-about-php-7

So PHP 7 has been released and it offers significant new features, including drastic speed changes (2 times faster according to Zend!).

As expected, PHP 7 doesn't work with vBulletin 4. The main reason is because of "methods with the same name as their class will not be constructors in a future version of PHP" and a couple of other things. So for example, the class vB_Database may not have a method name called vB_Database that's used as a constructor.

Since I have the latest vBulletin 4 version installed and I don't expect any new version of vBulletin 4 anytime soon, I'll probably give it a shot and modify my forum to see if I can make it work with PHP 7.

I will definitely document the speed changes and let you guys know the results.
Anyone else who may be interested in this?

--------------- Added [DATE]1449314753[/DATE] at [TIME]1449314753[/TIME] ---------------

After a couple of modifications, I managed to make vBulletin 4 work with PHP 7... and wow it loads so much faster. More than 2 times faster with PHP 7 and the OPCache module... wow. My mind is blown.

Note that all the numbers below are based on the TTFB (Time To First Byte).

Before the upgrade (PHP 5.4.45)
Homepage
409.31 - 429.84 - 389.37 - 401.51 - 389.75 - 426.69
~407.75ms average loading time

Forum Category
518.51 - 491.49 - 447.64 - 491.94 - 433.52 - 543.93
~487.84ms average loading time

Thread
326.34 - 399.72 - 387.09 - 383.79 - 370.03 - 375.21
~373.70ms average loading time

-----

After the upgrade (PHP 7 WITHOUT OPCache)
Homepage
289.79 - 291.41 - 289.11 - 253.45 - 285.06 - 259.98
~278.13ms average loading time

Forum Category
281.83 - 333.31 - 293.23 - 276.73 - 268.91 - 281.63
~289.27ms average loading time

Thread
221.73 - 344.83 - 257.84 - 250.72 - 250.04 - 220.07
~257.53ms average loading time

-----

After the upgrade (PHP 7 WITH OPCache)
Homepage
225.63 - 200.26 - 219.48 - 181.72 - 199.93 - 177.55
~200.76ms average loading time

Forum Category
194.95 - 184.47 - 237.45 - 182.62 - 185.93 - 178.06
~193.91ms average loading time

Thread
207.83 - 156.41 - 146.43 - 143.13 - 155.13 - 142.61
~158.59ms average loading time

https://vborg.vbsupport.ru/external/2015/12/34.png

RichieBoy67 12-05-2015 10:02 AM

Interesting. What did you have to do to make your site compatible?

Dave 12-05-2015 10:09 AM

On top of my head, I had to make changes to the following files:
  • includes/class_core.php (to fix constructor error)
  • includes/class_datastore.php (to fix constructor error)
  • includes/class_bbcode.php (to fix function name must be a string error)
  • includes/class_hook.php (to fix constructor error)
  • vb/exception/parser.php (to fix redefinition of argument error)
Also I had to change the datastore class in config.php back to vB_Datastore_Filecache since there's no PHP 7 version for APC/XCache or Memcached. You don't need it anymore anyway since OPCache has been introduced and it's extremely fast.

Another thing to keep in mind is that PHP 7 deprecates the mysql_* functions. In case you have any plugins or custom scripts installed which makes use of that then it will not work.

Elite_360_ 12-07-2015 08:05 PM

Quote:

Originally Posted by Dave (Post 2559760)
Since I have the latest vBulletin 4 version installed and I don't expect any new version of vBulletin 4 anytime soon

VB 4.2.4 beta 1 is coming out soon you should report the bug, and maybe it will be in VB 4.2.4

Dave 12-08-2015 09:56 AM

Quote:

Originally Posted by Elite_360_ (Post 2559921)
VB 4.2.4 beta 1 is coming out soon you should report the bug, and maybe it will be in VB 4.2.4

I've seen a ticket for the error in vb/exception/parser.php.
I don't know how the other changes I've made affect earlier versions of PHP, so not sure if they want to bother "fixing" that since they officially don't even support PHP 7.

Paul M 12-08-2015 03:55 PM

Quote:

Originally Posted by Dave (Post 2559939)
I've seen a ticket for the error in vb/exception/parser.php.
I don't know how the other changes I've made affect earlier versions of PHP, so not sure if they want to bother "fixing" that since they officially don't even support PHP 7.

The parser error was logged and fixed for php7 (by me) in vB5, I dont think its been logged for vB4 (or 3).

There is a Jira for vB4 php7 support, but thats about as far as its got atm (other than I have some test sites running).

Max Taxable 12-08-2015 04:49 PM

Performance about average, nothing amazing here. Assuming the site in your signature is the subject site. My sites perform significantly better.

http://www.webpagetest.org/result/151208_83_1K5H/

Dave 12-08-2015 04:56 PM

Quote:

Originally Posted by Max Taxable (Post 2559964)
Performance about average, nothing amazing here. Assuming the site in your signature is the subject site. My sites perform significantly better.

http://www.webpagetest.org/result/151208_83_1K5H/

No, it's not. It's just a very basic PHP site (not related to vBulletin).
I get an average TTFB of 20ms on that site.

--

The location of the test server at webpagetest.org affects the final result by a lot, which is why you can't use that as a reliable tool to find out how fast a site is unless you test it from America, Asia and Europe and compare the results.

Also if I compare my own results in Chrome's developer tools with the results of webpagetest.org, it doesn't match.
If I clear my browser and DNS cache, the first load of https://technidev.com (located in Amsterdam) takes 1.50 seconds, yet webpagetest.org (Amsterdam server) states 5 seconds.

Max Taxable 12-08-2015 05:11 PM

Quote:

Originally Posted by Dave (Post 2559965)
The location of the test server at webpagetest.org affects the final result by a lot, which is why you can't use that as a reliable tool to find out how fast a site is unless you test it from America, Asia and Europe and compare the results.

It's just real browsers with real connections, not servers at all. It's volunteer real-world computers, and the location really doesn't matter that much but the connection sure does. I test everything with one set of parameters, I don't test-shop. I optimize to worst case, not to what I might get on my own computer - that's not objective.

Care to provide a link to this super fast php7 vB4?

Max Taxable 12-08-2015 05:22 PM

I'm not trying to be a snark, I just see claims of millisecond load speeds and want to see that put to a real test. I've never seen millisecond load speeds.


All times are GMT. The time now is 09:58 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01028 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete