The overall optimization. Plugins

(Evgeny) #1

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.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.

(Régis Hanol) #2

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

(Evgeny) #3

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?

(Régis Hanol) #4

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

(Evgeny) #5

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

Perhaps it makes sense to use stopwords in the search?

(Sam Saffron) #6

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