# The overall optimization. Plugins

**URL:** <https://meta.discourse.org/t/the-overall-optimization-plugins/67732>\
**Category:** Development\
**Created:** [August 9, 2017, 8:19pm UTC](https://meta.discourse.org/t/the-overall-optimization-plugins/67732 "2017-08-09T20:19:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stranik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stranik/32/85638_2.png) [@Stranik](https://meta.discourse.org/u/Stranik)\
**Post date:** [August 9, 2017, 8:19pm UTC](https://meta.discourse.org/t/the-overall-optimization-plugins/67732/1 "2017-08-09T20:19:47Z")

</div>

A specific example. There are 2 plug-in.

**1.** 1/assets/javascripts/discourse/initializers/1.js.es6

```
 import { withPluginApi } from 'discourse/lib/plugin-api';
 import RawHtml from 'discourse/widgets/raw-html';

 function attachSignature(api) {
 api.includePostAttributes('reply_to_post_number');
 api.decorateWidget('post-contents:before', dec => {.....

```

**2.** 2/assets/javascripts/discourse/initializers/2.js.es6

```
import { withPluginApi } from 'discourse/lib/plugin-api';
function startVoting(api){....

```

As it is advisable to combine two or more plug-in to exclude the connection of the first rows…

```
 import { withPluginApi } from 'discourse/lib/plugin-api';
 import RawHtml from 'discourse/widgets/raw-html';

function 1(api) {...
function 2(api) {...

```

Will this affect performance?  
I look at common approaches…  
Just logically, you can make a dozen plugins or replace them all in one.

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [August 9, 2017, 11:10pm UTC](https://meta.discourse.org/t/the-overall-optimization-plugins/67732/2 "2017-08-09T23:10:00Z")

</div>

What’s the question here? I don’t understand.

---

<div class="post-metadata">

**Author:** ![Stranik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stranik/32/85638_2.png) [@Stranik](https://meta.discourse.org/u/Stranik)\
**Post date:** [August 9, 2017, 11:23pm UTC](https://meta.discourse.org/t/the-overall-optimization-plugins/67732/3 "2017-08-09T23:23:48Z")

</div>

It makes sense for the performance to make one common plugin than 10 different ones. After all, connecting almost identical files in 10 plug-ins than connecting them 1 time in one faster?

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [August 9, 2017, 11:25pm UTC](https://meta.discourse.org/t/the-overall-optimization-plugins/67732/4 "2017-08-09T23:25:36Z")

</div>

I guess. There is nothing faster than code you don’t execute. But I’m failing to understand the problem here.

---

<div class="post-metadata">

**Author:** ![Stranik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stranik/32/85638_2.png) [@Stranik](https://meta.discourse.org/u/Stranik)\
**Post date:** [August 9, 2017, 11:27pm UTC](https://meta.discourse.org/t/the-overall-optimization-plugins/67732/5 "2017-08-09T23:27:50Z")

</div>

There is one more question in order not to multiply topics.

Perhaps it makes sense to use stopwords in the search?  
[http://www.ranks.nl/stopwords](http://www.ranks.nl/stopwords)

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [August 11, 2017, 2:33am UTC](https://meta.discourse.org/t/the-overall-optimization-plugins/67732/6 "2017-08-11T02:33:39Z")

</div>

PG already has stop words built into each dictionary it supports.
