# Perspective: Binding efficiency between using Expression and Indirect Tag + Expression tranform

**URL:** <https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881>\
**Category:** Ignition\
**Tags:** perspective, ignition80\
**Created:** [September 21, 2020, 1:16am UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881 "2020-09-21T01:16:22Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 21, 2020, 1:16am UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/1 "2020-09-21T01:16:22Z")

</div>

v8.1.0

What’s more efficient and more performant for bindings:

1. Using an expression binding for example: `toBoolean(tag('tag/path/' + {parameterX}))`
2. Using an indirect tag binding and then applying an expression transform, e.g.:  
a)tag indirect binding: `tag/path/{1}`, {1} =\> `{parameterX}`  
b)expression transform: `toBoolean({value})`

---

<div class="post-metadata">

**Author:** ![michael2](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@michael2](https://forum.inductiveautomation.com/u/michael2)\
**Post date:** [September 21, 2020, 2:51am UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/2 "2020-09-21T02:51:14Z")

</div>

I’ll channel my inner pturmel and say don’t use the tag function. It’s better to create an indirect binding. If you need more than one tag in an expression binding you’re better off creating indirect bindings on custom properties and using those instead.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 21, 2020, 2:56am UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/3 "2020-09-21T02:56:47Z")

</div>

I knew Phil would most likely say that 😆 I guess I wondered if it’s still the most efficient in Perspective as well

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 21, 2020, 2:57pm UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/4 "2020-09-21T14:57:18Z")

</div>

My answer is a little more nuanced in Perspective if using structure bindings:

> [@Slow loading times after 8.0.14](http://forum.inductiveautomation.com/t/slow-loading-times-after-8-0-14/37413/5):
>
> Yes. Consider that tag values update repeatedly and asynchronously, while tag paths are typically evaluated only when a Perspective view/page opens. The reduction in work in an Expression Structure that only has to evaluate tag values (from custom props) as opposed to also evaluating tag paths (that are now only part of the custom props) is a win even though there are more bindings overall. Also consider that while an Expression Structure may be needed to deliver consistent data+config to a c…

Otherwise, yes, use indirect bindings.

---

<div class="post-metadata">

**Author:** ![weertske](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/weertske/32/3353_2.png) [@weertske](https://forum.inductiveautomation.com/u/weertske)\
**Post date:** [October 5, 2020, 6:10pm UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/5 "2020-10-05T18:10:06Z")

</div>

Please take a look at my new post, " [Perspective property binding with expression transform behaves differently than equivalent expression](http://forum.inductiveautomation.com/t/perspective-property-binding-with-expression-transform-behaves-differently-than-equivalent-expression/39382)"

I could use your input. Thanks.

---

<div class="post-metadata">

**Author:** ![321liftoff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/321liftoff/32/27544_2.png) [@321liftoff](https://forum.inductiveautomation.com/u/321liftoff)\
**Post date:** [October 5, 2021, 7:27pm UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/6 "2021-10-05T19:27:37Z")

</div>

There is great content in this thread, so I would like to extend the question a bit:

- Given there is a Perspective label component intended to display a tag’s value
- Given this label’s text property is bound to `view.custom.tagValue` through a Property binding

@pturmel Which type of binding is best regarding performance for the `view.custom.tagValue` property to accommodate a dynamic tag-path (if there is a difference):

**Option 1:** A Tag Binding using “Indirect”, such as `{tagPath}+'/static/portion/of/path'`, where `tagPath` is a reference and the property is `{view.params.tagPath}`

**Option 2:** A Tag Binding using “Expression”, such as `{view.params.tagPath}+'/static/portion/of/path'`

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 5, 2021, 7:41pm UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/7 "2021-10-05T19:41:06Z")

</div>

Isn’t this the same question as my OP? ~~Your option 2 wouldn’t work as you expect btw, it will literally just return a string with your tag path. If you want to actually read the tag path in the expression language you would need to use tag()~~  
My bad

---

<div class="post-metadata">

**Author:** ![321liftoff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/321liftoff/32/27544_2.png) [@321liftoff](https://forum.inductiveautomation.com/u/321liftoff)\
**Post date:** [October 5, 2021, 7:51pm UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/8 "2021-10-05T19:51:58Z")

</div>

I didn’t think so, but maybe I’m wrong. I thought your question was the difference between the following:

1. Label text with expression Binding `tag('tag/path/' + {parameterX})`
2. Label text with Tag binding _“Indirect”_: `tag/path/{1}` , {1} =\> `{parameterX}`

I’m asking about option 3:  
3. Label text with Tag binding _Expression_ `'tag/path/' + {parameterX}`

Why wouldn’t Option 2 in my post above work using a TagBinding with expression?  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/d/ddeb94f710a25b5acfbfdfba6063570bdf96521b.png)

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 5, 2021, 7:53pm UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/9 "2021-10-05T19:53:59Z")

</div>

Oohh, I always forget that there’s that new tag binding option in 8. I thought you were talking about an expression binding itself. Awks 😅 now I’m intrigued as to the answer as well

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 5, 2021, 8:00pm UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/10 "2021-10-05T20:00:37Z")

</div>

All ‘tag’ binding types in Perspective are ultimately using the same code to create the binding, so there’s not really going to be any significant difference. I would use an indirect tag binding unless you specifically need the extra ‘power’ of an expression there.

The advice to avoid `tag()` still stands.

---

<div class="post-metadata">

**Author:** ![321liftoff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/321liftoff/32/27544_2.png) [@321liftoff](https://forum.inductiveautomation.com/u/321liftoff)\
**Post date:** [October 7, 2021, 3:23am UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/11 "2021-10-07T03:23:11Z")

</div>

I really don’t need the extra power of an expression but if there is only one property, then I prefer expressions over the indirect tag binding because it is quicker to implement a binding; the expression tag binding doesn’t need a middle-man reference variable.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/0/d02e8e70a5a9a2b8c4d25091f4dc2cbfd12212e0.png)

vs

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/e/fe3c69589c98c1b2bf8261a7d4a29e66b96a6c2b.png)

Thanks for the clarification.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [October 7, 2021, 4:11am UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/12 "2021-10-07T04:11:37Z")

</div>

This is where i tend to just use the old number-based method we were always forced to use pre-8. It’s far quicker to type and I don’t find adding a text description offers much since the most I’ve ever tried to reference out was 2, maybe 3 parts. If you’re doing more than that, then it should probably be moved out into a custom property so that you can reuse it multiple times without having to reference those same 3,4,5+ references everywhere you need them inside of indirect tag bindings:

```auto
tag/path/{1}

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 7, 2021, 11:16am UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/13 "2021-10-07T11:16:30Z")

</div>

There is a slight performance advantage to using a ‘middleman’ with an indirect binding. That is, it avoids setting up an expression context and executing it on every update of the binding.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 1, 2021, 8:14pm UTC](https://forum.inductiveautomation.com/t/perspective-binding-efficiency-between-using-expression-and-indirect-tag-expression-tranform/38881/14 "2021-11-01T20:14:40Z")

</div>

2 posts were split to a new topic: [Indirect tag binding setup](https://forum.inductiveautomation.com/t/indirect-tag-binding-setup/52588)
