Page 1 of 1

Shorthand vs Longhand impact on performance?

Posted: Sun Feb 08, 2015 10:56 am
by Bakkone
Hi,

Does anyone know if using a longhand instead of shorthand has any effect on performance?
In other words, does writing ['Dimension':'Element'] perform worse than writing ['Element'] in a rule?

Re: Shorthand vs Longhand impact on performance?

Posted: Sun Feb 08, 2015 2:06 pm
by Harvey
Rules are supposedly compiled, so in theory it should make no difference. TM1 is a quirky beast, though, so if you have some evidence it might, I'd be interested to hear it.

Re: Shorthand vs Longhand impact on performance?

Posted: Sun Feb 08, 2015 2:15 pm
by lotsaram
Bakkone wrote:Hi,

Does anyone know if using a longhand instead of shorthand has any effect on performance?
In other words, does writing ['Dimension':'Element'] perform worse than writing ['Element'] in a rule?
Normally when talking about "shorthand" vs "longhand" rules is taken to mean ['Element'] vs DB('cube',!dim1,!dim2,...'Element') on the right hand side of the rule. There is some evidence that the square bracket shorthand actually performs a little better than full DB reference. I haven't ever tested this myself but there are people who have and this is what they claimed to observe. For dimension qualified vs unqualified shorthand I would tend to suspect that qualifying the element reference with the correct dimension might be faster since you are saving TM1 the effort of evaluating which dimension the element comes from. I certainly wouldn't expect it to perform worse.

Re: Shorthand vs Longhand impact on performance?

Posted: Sun Feb 08, 2015 7:16 pm
by Duncan P
The evaluation of which dimension it is from is done at compile time - as you will see if you use an ambiguous name. There is no effect on runtime performance.

Re: Shorthand vs Longhand impact on performance?

Posted: Mon Feb 09, 2015 10:36 am
by Bakkone
lotsaram wrote: Normally when talking about "shorthand" vs "longhand" rules is taken to mean ['Element'] vs DB('cube',!dim1,!dim2,...'Element') on the right hand side of the rule.
Thanks for your reply. Im new at this so haven't really figured out the lingo yet. Ill call it "midhand" from now on.

Glad to hear it shouldnt have any impact on performance.