Emoticate plugin dramatically reduces performance

Found a bug? Tell us!!
Post Reply
DragonLord
Regular
Posts: 7
Joined: Sat Feb 08, 2014 8:21 pm

Emoticate plugin dramatically reduces performance

Post 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.
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Emoticate plugin dramatically reduces performance

Post 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
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Emoticate plugin dramatically reduces performance

Post 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?
DragonLord
Regular
Posts: 7
Joined: Sat Feb 08, 2014 8:21 pm

Re: Emoticate plugin dramatically reduces performance

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Emoticate plugin dramatically reduces performance

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply