Page 1 of 2

Plugin Compiler Optimization

PostPosted: Tue Dec 11, 2018 1:48 pm
by SBarnes
Is there any optimisation of plugins when they are compiled that is similar to the settings for Visual Studio?

Re: Plugin Compiler Optimization

PostPosted: Tue Dec 11, 2018 1:49 pm
by Mike.Sheen
The only compilation options we set is:

/target:library
and
/platform:x86

Re: Plugin Compiler Optimization

PostPosted: Tue Dec 11, 2018 1:53 pm
by SBarnes
Is this configurable or hardwired?

My reasons for asking is with some fairly heavy processing that may be necessary is it better to do which one of the following options:

    1. Straight plugin
    2. Embedded reference in a plugin
    3. Separate program

Re: Plugin Compiler Optimization  Topic is solved

PostPosted: Tue Dec 11, 2018 2:15 pm
by Mike.Sheen
We don't have a hook in there to override the compiler options - so I've added improvement DEV-6994 to add one.

I'd be pretty surprised if compiler optimisations will do anything of real significance for you in terms of performance anyway - pretty easy to test though if you are able to make it a stand-alone executable or library - compile it once without optimisations, run and measure, then repeat with optimisations on.

Re: Plugin Compiler Optimization

PostPosted: Tue Dec 11, 2018 2:21 pm
by SBarnes
Hi Mike,

if you don't mind the suggestion it might not hurt to have a field on the plugins table so it was done plugin by plugin.

Where I have also actually seen the optimisations make a difference believe it or not was on a separate project that used ServiceStack and ORMLite.

Thanks for the response.

Re: Plugin Compiler Optimization

PostPosted: Tue Dec 11, 2018 8:35 pm
by Mike.Sheen
SBarnes wrote:if you don't mind the suggestion it might not hurt to have a field on the plugins table so it was done plugin by plugin.

Where I have also actually seen the optimisations make a difference believe it or not was on a separate project that used ServiceStack and ORMLite.


We'll put some consideration how we can let you define compiler flags per plugin, but if a plugin were to be able to subscribe to an event that something was about to be compiled with a way of setting compiler options such as -optimize then at least you could put conditional logic in there based on the plugin properties such as name.

The other option is to put in inline IL in the plugin code. It removes the compiler from having to decide for you on how to optimise. I've seen some libraries do that (ServiceStack is one).

My gut feeling is whatever you're needing to eek out more performance from might be able to be achieved with some lateral thinking about how you're doing whatever it is you are doing. I'm up for the challenge if you can provide an isolated and focused problem - maybe some other forum viewers would be up for that also!

Re: Plugin Compiler Optimization

PostPosted: Fri Feb 15, 2019 2:35 pm
by pricerc
(kind of) related, so thought I'd ask the question here rather than start a new thread.

Any chance of enabling string interpolation in a (near) future version?

Re: Plugin Compiler Optimization

PostPosted: Fri Feb 15, 2019 4:57 pm
by Mike.Sheen
pricerc wrote:(kind of) related, so thought I'd ask the question here rather than start a new thread.

Any chance of enabling string interpolation in a (near) future version?


Sure - we just need to wait until the Actipro SyntaxEditor editor guys update their WinForms control. They've been promising for a while now to unify their codebase between WinForms, WPF and UWA - their WPF and UWA Syntax Editor controls have supported C# 6.0 for a while now (the version string interpolation was introduced into C#), but Winforms got left behind and they're now trying to pull it into the fold with the other cool kids.

I check in on their progress every month or so - they haven't released anything yet, but are progressing. Their last blog post relating to this was on December 12 2018.

Re: Plugin Compiler Optimization

PostPosted: Fri Feb 15, 2019 5:12 pm
by SBarnes
If we are talking stuff in terms of plugin functionality I would prefer to see the following

1. Support for encrypting source code, where Jiwa might control the master key of each JSP as IP protection.
2. Support for Source control such as link to GitHub.

Re: Plugin Compiler Optimization

PostPosted: Fri Feb 15, 2019 11:24 pm
by pricerc
SBarnes wrote:If we are talking stuff in terms of plugin functionality I would prefer to see the following

1. Support for encrypting source code, where Jiwa might control the master key of each JSP as IP protection.
2. Support for Source control such as link to GitHub.


While those are noble goals, my question was about something way more trivial :) (which Mike has answered more-or-less as I expected).

(although I'm not currently terribly concerned about IP, because most of what I do is paid for by my customers on a time-and-material basis - I know some folk have a different model, but that's not how I usually work)