# Is "setv" less performant?

**URL:** <https://discourse.bokeh.org/t/is-setv-less-performant/7747>\
**Category:** Community Support\
**Created:** [May 4, 2021, 8:47am UTC](https://discourse.bokeh.org/t/is-setv-less-performant/7747 "2021-05-04T08:47:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![roinr](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/roinr/32/2269_2.png) [@roinr](https://discourse.bokeh.org/u/roinr)\
**Post date:** [May 4, 2021, 8:47am UTC](https://discourse.bokeh.org/t/is-setv-less-performant/7747/1 "2021-05-04T08:47:28Z")

</div>

I’ve created a custom select widget and I’m using the `setv` method for updating model’s properties.  
Recently I found out that when there’s a large amount of options in the dropdown, the widget gets stuck after selecting a few options (right at the point where the `value` property should get updated).  
After going through Bokeh’s built-in widget definitions I noticed that usually a regular assignment is used instead of using `setv`. What’s the difference between the two? Is `setv` known for a tendency to be less performant in some cases?

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [May 4, 2021, 4:31pm UTC](https://discourse.bokeh.org/t/is-setv-less-performant/7747/2 "2021-05-04T16:31:05Z")

</div>

`setv` is a lower-level implementation detail. There is never any reason to use it unless you need to pass one of the specialized options e.g. `{silent: true}` to it, but this is rare/unusual, even in the BokehJS codebase itself.

---

<div class="post-metadata">

**Author:** ![mateusz](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/mateusz/32/762_2.png) [@mateusz](https://discourse.bokeh.org/u/mateusz)\
**Post date:** [May 4, 2021, 7:03pm UTC](https://discourse.bokeh.org/t/is-setv-less-performant/7747/3 "2021-05-04T19:03:32Z")

</div>

Property assignment is equivalent to calling `setv()`, see:

> <https://github.com/bokeh/bokeh/blob/7d605a0cd4f7f20a434273a594273e3e632041ee/bokehjs/src/lib/core/has_props.ts#L119-L121>

---

<div class="post-metadata">

**Author:** ![roinr](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/roinr/32/2269_2.png) [@roinr](https://discourse.bokeh.org/u/roinr)\
**Post date:** [May 5, 2021, 5:16am UTC](https://discourse.bokeh.org/t/is-setv-less-performant/7747/4 "2021-05-05T05:16:10Z")

</div>

@Bryan @mateusz Thank you!
