Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Super Speedy UserCP Details »
Super Speedy UserCP
Mod Version: 1.01, by Birched (Member) Birched is offline
Developer Last Online: Jan 2020 I like it Show Printable Version Email this Page

vB Version: 3.8.4 Rating: (5 votes - 4.80 average) Installs: 54
Released: 08 Aug 2009 Last Update: Never Downloads: 0
Supported Code Changes Re-usable Code Translations  

TIME TO INSTALL: 10 seconds (requires editing of one file in one place)

This simple code modification increases my usercp.php loading speed by 6x. I think it will be most useful in cases where there are many subscribed forums.

It is listed as a modification for version 3.8.3 (which I am currently working with), but this mod works as far back as 3.0.1 (the 'find' text might be slightly different, but the function name and the text you replace is the same).
EDIT: Tested up to 3.8.4.

It works because the php function is_array() is excruciatingly slow, and an empty array gives the same return value as an empty variable.

This code would likely break if someone introduced a location in the code where the $lastpostarray variable was set to something (i.e. not nothing) that was not an array.

There are lots of these checks in the vBulletin code. It's likely that further speed increases could be achieved by changing more of them -- just remember that there is an unlikely circumstance (see previous paragraph) where it would cause problems. If you find other locations with significant effects, please post them in a reply!

##### IN FILE

functions_forumlist.php

##### FIND

function construct_forum_bit($parentid, $depth = 0, $subsonly = 0)
{
global $vbulletin, $stylevar, $vbphrase, $show;
global $imodcache, $lastpostarray, $counters, $inforum;

// this function takes the constant MAXFORUMDEPTH as its guide for how
// deep to recurse down forum lists. if MAXFORUMDEPTH is not defined,
// it will assume a depth of 2.

// call fetch_last_post_array() first to get last post info for forums
if (!is_array($lastpostarray))

##### REPLACE

if (!is_array($lastpostarray))

##### WITH

if (!$lastpostarray)

#####

And that's it! Enjoy, and I hope it helps!

Download Now

Only licensed members can download files, Click Here for more information.

Supporters / CoAuthors

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
End-User Options Change your UserCP Navbar with the New UserCP Dropdown Menu! Nоrman vBulletin 3.7 Add-ons 40 10 Jun 2009 18:43
End-User Options GTUserCP - Enhanced USERCP Interface + USERCP Menu Princeton vBulletin 3.6 Template Modifications 440 19 Jun 2008 20:00

  #16  
Old 09 Aug 2009, 11:39
Birched Birched is offline
 
Join Date: Sep 2007
Originally Posted by unp View Post
Its still ' if (!$lastpostarray)' in the frst post.
So what should it be ?
The error was the letter 'i' that used to be there (look more closely.)
Reply With Quote
  #17  
Old 09 Aug 2009, 11:42
Birched Birched is offline
 
Join Date: Sep 2007
Originally Posted by unp View Post
I get and error with if (!$lastpostarray)


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

With if ($lastpostarray) All post/view are Zero on forumhome.
Please post your modified code. That is what you'd get with a typo.
Reply With Quote
  #18  
Old 09 Aug 2009, 12:20
unp unp is offline
 
Join Date: Oct 2008
I tried again and it worked.I must have done something wrong the first time.
__________________
UNP
Reply With Quote
  #19  
Old 09 Aug 2009, 22:28
TWTCommish's Avatar
TWTCommish TWTCommish is offline
 
Join Date: Oct 2001
Real name: Chris
I assume this only speeds up the UserCP if the user has subscribed to forums? I ask because very few of my users use that feature.
__________________
Ask me about how to purchase vB Quiz for vBulletin 3.7 (works with 3.8, too)!

Websites: Movie Forums | Go Quiz
Reply With Quote
  #20  
Old 10 Aug 2009, 02:27
Birched Birched is offline
 
Join Date: Sep 2007
Originally Posted by TWTCommish View Post
I assume this only speeds up the UserCP if the user has subscribed to forums? I ask because very few of my users use that feature.
That's what it looks like. It's easy to try, though.
Reply With Quote
  #21  
Old 10 Aug 2009, 19:12
merkaz merkaz is offline
 
Join Date: Sep 2008
Amazing .

good job . thanks
Reply With Quote
  #22  
Old 12 Aug 2009, 17:50
NLP-er's Avatar
NLP-er NLP-er is offline
 
Join Date: Aug 2008
Real name: Michał Podbielski
Rated, installed

Small things can make big difference
__________________
vBulletin Enterprise Translator (vBET) - your forum in 53 languages - get more traffic, users and incomes from AdSense!
Reply With Quote
  #23  
Old 04 Sep 2009, 16:24
GhoHan's Avatar
GhoHan GhoHan is offline
 
Join Date: Oct 2007
Real name: GhoHan
Nice idea ... good installed
Reply With Quote
  #24  
Old 04 Sep 2009, 23:27
testebr testebr is offline
 
Join Date: Jan 2004
You already reported this 'issue' on vb.com board?
Reply With Quote
  #25  
Old 05 Sep 2009, 00:08
nomoreturn's Avatar
nomoreturn nomoreturn is offline
 
Join Date: Apr 2009
Real name: mastdunya.com
Thanks works great on 3.8.4
Reply With Quote
  #26  
Old 16 Sep 2009, 14:03
Birched Birched is offline
 
Join Date: Sep 2007
Originally Posted by testebr View Post
You already reported this 'issue' on vb.com board?
The problem has been mentioned previously both there (vbulletin.com) and here (vbulletin.org) (earlier by others, more recently by myself). The vbulletin coders would have to make a "substance over style" decision to implement this change in the core code, at least in the specific manner in which I've implemented it. I don't think that's very likely, but who knows? The issue has been around for a long time....
Reply With Quote
  #27  
Old 24 Jun 2010, 14:26
WebkinzCoast's Avatar
WebkinzCoast WebkinzCoast is offline
 
Join Date: Jan 2009
Originally Posted by TWTCommish View Post
I assume this only speeds up the UserCP if the user has subscribed to forums? I ask because very few of my users use that feature.
Actually, it sped up mine by a good five seconds and I have no subscribed forums.
Reply With Quote
  #28  
Old 24 Jun 2010, 14:26
WebkinzCoast's Avatar
WebkinzCoast WebkinzCoast is offline
 
Join Date: Jan 2009
Working great over here!
Reply With Quote
  #29  
Old 24 Jun 2010, 16:28
mahz mahz is offline
 
Join Date: Mar 2006
Cool. I have a large forum with a lot of heavy subscribed-threads usage. I already marked Installed and rated (I love simple code optimizations), but I like numbers/metrics and would like to see if it changes anything and by what margin.

What's a good way to see page load times? I'm a total noob.

How do I turn off caching, too, so I can get more realistic numbers?

Thanks!
Reply With Quote
  #30  
Old 25 Jun 2010, 00:12
New Joe's Avatar
New Joe New Joe is offline
 
Join Date: May 2009
Works fine and fast.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 15:41.

Layout Options | Width: Wide Color: