The overall optimization. Plugins

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.

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

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?

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

1 Like

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

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

3 Likes