Page 1 of 1

Emoticate plugin dramatically reduces performance

Posted: Sat Apr 19, 2014 7:06 am
by DragonLord
I'm running Serendipity on a Linode 2GB server and I've been experiencing poor performance. However, as soon as I disable the Emoticate plugin, performance jumps dramatically.

With the plugin enabled, I get about 29 requests per second on the front page. When the plugin is disabled, however, that number jumps to 51. I can reliably reproduce this issue by benchmarking the server after enabling and disabling the plugin. Is there any reason why this plugin is so slow? (I don't need this plugin, but it is enabled by default, so users could be getting much better performance just by removing this plugin, hence this being posted in the Bugs section.)

--DragonLord

Edit: I've since reduced the number of entries on the main page from 15 to 10 to further improve performance.

Re: Emoticate plugin dramatically reduces performance

Posted: Sat Apr 19, 2014 11:09 am
by yellowled
DragonLord wrote:However, as soon as I disable the Emoticate plugin, performance jumps dramatically.
That is especially irritating since you don't even seem to use that many emoticons.

Just to avoid confusion, what exactly do you mean by “requests per second”? Is that a benchmarked value only or do you also “see” a drop in e.g. page rendering speed?

YL

Re: Emoticate plugin dramatically reduces performance

Posted: Sat Apr 19, 2014 4:23 pm
by onli
https://github.com/s9y/Serendipity/blob ... e.php#L168 could be a problem (it was PHP that didn't like having funktions as start of a foreach, exekuting it each time, or?). Also, this plugin will read a lot of markup files on every page request, in https://github.com/s9y/Serendipity/blob ... te.php#L63, that alone could be a problem. Also, if I understand it correctly, other then other markup plugins this plugin is not cached. Garvin?

Edit: Uh, https://github.com/s9y/Serendipity/blob ... te.php#L24, maybe it is cached. But doesn't this need to be called in the event-hook as well?

Re: Emoticate plugin dramatically reduces performance

Posted: Sat Apr 19, 2014 7:14 pm
by DragonLord
By "requests per second", I mean the rate at which the blog's home page can be generated and served to users, measured using benchmark program called Siege. It is inversely proportional to the time it takes to generate the page.

--DragonLord

Re: Emoticate plugin dramatically reduces performance

Posted: Thu Apr 24, 2014 1:41 pm
by garvinhicking
Hi!

Maybe you could try what onli propsed, edit the file and change:

Code: Select all

foreach ($this->getEmoticons() as $key => $value) {
to:

Code: Select all

$smilies = $this->getEmoticons();
foreach ($smilies as $key => $value) {
and see how that matters?

It could also be that the pathinfo() PHP file is expensive, in that case you could comment out the line:

Code: Select all

// $path_parts = pathinfo($value);
Other than that I don't really see that much of a reason,...

Regards,
Garvin