Kepler/SIL/JJupin - Does including a UDR library affects execution time of code?

Hello,

 

Lately we have started to build our own User Defined Routines library with all the little useful functions that we often call. We are also trying to improve the efficiency of our code. That made me wondering what is the effect of including a library in each script we use? Is there any slowdown at all if we just include the library, even if we won't use any function from included UDR?

1 answer

1 accepted

This widget could not be displayed.

Hi Blazej,

 

There is always a cost. When you define a UDR, when the script is interpreted, the UDR should be saved for later use. Even if you don't use it, the routine has to be defined. It is always recommended to include what you're actually using. You should group your routines by their logic(e.x. arrayUtils.incl should include array routines) and include them when you're actually using.

If you're using some routines more frequently from a library script, maybe it's a sign they are different than the rest of the script and should be moved in a different script. Find a balance between how much a script should contain and how many scripts should be included. There is no right answer(I/O is slow, but maybe with a SSD is faster to use multiple smaller scripts).

 

So, in short, you should avoid including functions you don't use. If they are general purpose functions, they might be included into the SIL core and you'll get what you want: speed and all functions available. We are open to suggestions but we'll try to keep the language clean and simple. You can suggest new routines using our mailing support or our JIRA instance for bugs.

 

Best regards,

Silviu

Well, you could use caching to spare parse time. Caching is disabled by default, but can be enabled on the scripts very easily. This would avoid such time costs.

@Silviu Burcea Thank you for the directions. Most of the routines that we use are specific to our instance I think, so there is no need to nag you guys about it :) @Radu Dumitriu Do you mean caching set in the SIL Configuration page? Are there any risks connected to caching? Are there any scenarios that caching may slow down executing time of scripts?

AFAIK, no, there are no risks. Cache should update automatically when you change the script. When we introduced it, we didn't want to make it the default (we were scared on possible side-effects). Our plan was to add this as default later on. However, in the fury of N-th developments, this 10 minute task is still in our backlog. (ashamed) As we speak, no bug has been reported on the cache.

Thanks for the valuable information. I'll try to turn the caching on as soon as possible.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

286 views 5 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you