How does plugins work internally? (Is it worth minimizing)

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.

  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;

How does plugins work internally? (Is it worth minimizing)

Postby pmk65 » Sat May 30, 2015 10:44 pm

How does plugins work internally?

I was wondering what happens to plugins once loaded into WeBuilder. And if it's worth minimizing the script code, removing comments etc.

So:
1) Does the plugin script get "compiled" to some internal code when plugin is enabled?
2) Or does it run it in "script" mode?
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark

Re: How does plugins work internally? (Is it worth minimizin

Postby Aivars » Wed Jun 03, 2015 11:33 am

Basically all plugins are run when WeBuilder is launched, at which point the plugin script is compiled (to a sort of bytecode) and executed. During initialization plugins should only declare variables and initialize events so they won't have any impact to startup times. After that plugin code is executed only when the corresponding events are triggered, so if plugin only creates menu items, any of its code won't be executed unless these menu items are clicked.
There is no need to minimize script, it won't have any impact. It's better if the code is clear and understandable so that everyone who wants can learn. What you should rather pay attention is memory leaks - e.g. if script constantly creates more and more new objects without freeing them, it could fill up the memory.
Blumentals Software Programmer
User avatar
Aivars
Blumentals Software Developer
 
Posts: 2456
Joined: Thu Aug 22, 2002 1:40 pm
Location: Latvia

Re: How does plugins work internally? (Is it worth minimizin

Postby pmk65 » Thu Jun 04, 2015 5:08 pm

Thanks for the feedback.
That was more or less as I expected. Specially when you have to disable/enable plugins for changes to take effect.
There are 10 types of people in the world: Those who understand binary and those who don't.
User avatar
pmk65
 
Posts: 678
Joined: Sun Dec 20, 2009 9:58 pm
Location: Copenhagen, Denmark


Return to HTMLPad / Rapid CSS / Rapid PHP / WeBuilder Support

Who is online

Users browsing this forum: No registered users and 20 guests

cron