GoLang Plugins compilation taking more time

I’m using the plugin concept in golang in my project. ( go build -buildmode=plugin )
for one plugin to compile to .so file it is taking average time of 15 seconds.
If i want to convert three to four plugins it is taking almost 45 seconds.
Is there any way to reduce this time of compilation to .so files
any alternate way to compile faster
atleast can reduce the time of multiple plugins( i.e can i run all the plugins parallely so that the idle time will be 15 seconds always)

This is the command i use in a loop , that iterates in a List and and executes the same command :

**go build -buildmode=plugin -o "classes/"+List[i]+".so "+  "classes/" + List[i].action + ".go"**

How are you running that command in a loop? Is it in a shell script, or something else?

I am executing this shell command with the help of a nodejs process

I am not familiar with Node, but I suggest that you look for a way to start the commands in parallel from there. If you were running the compilation from Go itself, I could help you, but, like I said, I don’t know Node.

Thank you for the suggestion.
Nodejs is a asynchronous code execution so this loop almost start at same time .i.e. the commands almost run at same time.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.