Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up parseSmilies in MessageParser #2113

Closed
wants to merge 1 commit into from

Conversation

ramiusGitHub
Copy link
Contributor

If the WCF holds many smilies (thousands, e.g. due to the emoji plugin by SoftCreatR), the loop in the parseSmilies function needs a significant amount of time. Checking beforehand with strpos and only calling preg_replace, if the smiley was found at least one time, leads to an improved performance.

If the WCF holds many smilies (thousands, e.g. due to the emoji plugin by SoftCreatR), the loop in the parseSmilies function needs a significant amount of time. Checking beforehand with strpos and only calling preg_replace, if the smiley was found at least one time, leads to an improved performance.
Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have got any hard numbers?

@ramiusGitHub
Copy link
Contributor Author

My WBB has around 3000 smilies (about 100 standard smilies, 1000 for SoftCreatR's emoji plugin and 2000 icons from the game Dota 2). A thread page with 20 posts each around two to three lines of text needed 0.8s before and 0.5s after the above optimization.
I know having 3000 smilies is not the point of the smiley system, however, this change does not have a negative effect on any other types of using the WBB.

@dtdesign dtdesign closed this Oct 4, 2016
@dtdesign
Copy link
Member

dtdesign commented Oct 4, 2016

Feel free to make such a modification to your own system, I seriously doubt we'll make any changes to that specific file in the 2.1 branch.

This is far beyond what I'm comfortable merging into the stable branch anyway and there has never been a real need for such a change, making it a risky move without a significant reason for us.

@ramiusGitHub
Copy link
Contributor Author

I guess with the Emoji Plugin by SoftCreatR there are many WBBs that suffer at least 0.1 seconds per thread view.

I can apply that change locally, but won't it be overriden with every WCF update that uses the file PIP?

@ffl096
Copy link
Contributor

ffl096 commented Oct 4, 2016

I can apply that change locally, but won't it be overriden with every WCF update that uses the file PIP?

Only by updates with changes to the MessageParser. WoltLab usually provides file archives which only contain the files changed since the last version. Therefore, only those files are overwritten with the version from the archive and other files remain untouched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants