# Does Callbackproperty destroy primitives behind the scenes?

**URL:** <https://community.cesium.com/t/does-callbackproperty-destroy-primitives-behind-the-scenes/11851>\
**Category:** CesiumJS\
**Created:** [December 23, 2020, 4:21pm UTC](https://community.cesium.com/t/does-callbackproperty-destroy-primitives-behind-the-scenes/11851 "2020-12-23T16:21:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Baruch\_Levin](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/baruch_levin/32/2400_2.png) [@Baruch\_Levin](https://community.cesium.com/u/Baruch_Levin)\
**Post date:** [December 23, 2020, 4:21pm UTC](https://community.cesium.com/t/does-callbackproperty-destroy-primitives-behind-the-scenes/11851/1 "2020-12-23T16:21:39Z")

</div>

Hello,

I try to create an entity which change position dynamically.

To make the entity not blinking i use Callbackproperty.

And then i thought, entity is an abstract above primitives. So does it mean that because it use Callbackproperty it destroy behind the scenes all the primitives and recreate them EVERY FRAME?!?!?!

If so, maybe it better for me to not use entity, and to create and recreate the primitives by myself.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [December 23, 2020, 9:59pm UTC](https://community.cesium.com/t/does-callbackproperty-destroy-primitives-behind-the-scenes/11851/2 "2020-12-23T21:59:49Z")

</div>

@Baruch_Levin yes, the Entity API is great for rendering things that either change constantly, or never change, but isn’t always great for drawing geometry that changes intermittently.

One solution for this would be to use a `CallbackProperty` while you know a value is going to change, and set the value back to a `ConstantProperty` once it has finished changing.

Cheers,

Hannah  
Cesium Staff

---

<div class="post-metadata">

**Author:** ![James\_B](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/james_b/32/2424_2.png) [@James\_B](https://community.cesium.com/u/James_B)\
**Post date:** [December 27, 2020, 12:39pm UTC](https://community.cesium.com/t/does-callbackproperty-destroy-primitives-behind-the-scenes/11851/3 "2020-12-27T12:39:19Z")

</div>

If a `CallbackProperty` returns the same value (strict / reference equality, if that matters) on subsequent calls, will it still perform noticeably worse than `ConstantProperty`? I had assumed that somebody in that pipeline was clever enough to check if the value had changed.

A frequent pattern that I use is to make entities with CallbackProperties that simply return some external value – say, looking up an entry in a `Map` of position-arrays for a Polyline’s `positions`. Then, when an event causes the value to change, I just update the `Map` entry, and on next render the new value will be used. This seems to perform well.
