You are aware that there is an extra setting area for this in the config.php where you can switch the default datastore handler to memcached?
It's completely disastrous and unnecessary to re-code all hacks if this can be done with uncommenting a codeblock.
Read this:
https://www.vbulletin.com/forum/entr...percharge-your...
I highly recommend to update the first post.