# Why is my Color Chooser's frame rate with Vue so much higher than with CanJS?

**URL:** <https://forums.bitovi.com/t/why-is-my-color-choosers-frame-rate-with-vue-so-much-higher-than-with-canjs/986>\
**Category:** CanJS\
**Created:** [November 7, 2018, 4:20pm UTC](https://forums.bitovi.com/t/why-is-my-color-choosers-frame-rate-with-vue-so-much-higher-than-with-canjs/986 "2018-11-07T16:20:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![code-read](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/code-read/32/111_2.png) [@code-read](https://forums.bitovi.com/u/code-read)\
**Post date:** [November 7, 2018, 4:20pm UTC](https://forums.bitovi.com/t/why-is-my-color-choosers-frame-rate-with-vue-so-much-higher-than-with-canjs/986/1 "2018-11-07T16:20:05Z")

</div>

If you compare frame rates of the following pages, you will understand my question:

[CanJS Color Chooser](http://canjs-colors.code-read.com/?demo=true)

[Vue Color Chooser](http://vue-colors.code-read.com/?demo=true)

**Details:**  
If you click either of the links above, a _Color Chooser_ page should run in _Demo Mode_, _choosing_ random _base colors_ which cause their _final color_ grids to update as quickly as possible. An _Average frames/sec_ indicator shows frame rate.

In the case of CanJS, the reported rate is several times lower than for Vue. The disparity is more evident the larger the final color grid; stretch your browser window or zoom out to enlarge it.

Source code for CanJS Color Chooser is at [https://github.com/CODE-REaD/CanColorChooser1](https://github.com/CODE-REaD/CanColorChooser1) ; source code for Vue Color Chooser is at [https://github.com/CODE-REaD/VueColorObjectChooser](https://github.com/CODE-REaD/VueColorObjectChooser).

Related topic: [Color Chooser Illustrates ViewModel Hierarchy Questions](https://forums.bitovi.com/t/color-chooser-illustrates-viewmodel-hierarchy-questions/938/12?u=code-read)

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [November 7, 2018, 4:41pm UTC](https://forums.bitovi.com/t/why-is-my-color-choosers-frame-rate-with-vue-so-much-higher-than-with-canjs/986/2 "2018-11-07T16:41:12Z")

</div>

This app is ideally suited for a vdom/diff approach as lots of “inner” values are changing (colors), but the “boxes” are being left in place.

To make canjs use it’s diff, you will have to add identity keys around here: [https://github.com/CODE-REaD/CanColorChooser1/blob/master/chooser3.js#L289](https://github.com/CODE-REaD/CanColorChooser1/blob/master/chooser3.js#L289)

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [November 7, 2018, 8:16pm UTC](https://forums.bitovi.com/t/why-is-my-color-choosers-frame-rate-with-vue-so-much-higher-than-with-canjs/986/3 "2018-11-07T20:16:00Z")

</div>

Do you have this in a codepen? I can show how to make this change in a codepen.

---

<div class="post-metadata">

**Author:** ![code-read](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/code-read/32/111_2.png) [@code-read](https://forums.bitovi.com/u/code-read)\
**Post date:** [November 7, 2018, 9:58pm UTC](https://forums.bitovi.com/t/why-is-my-color-choosers-frame-rate-with-vue-so-much-higher-than-with-canjs/986/4 "2018-11-07T21:58:31Z")

</div>

Here it is in a CodePen:

https://codepen.io/codeREaD/embed/preview/jQWYPr?height=300&slug-hash=jQWYPr&default-tabs=js,result&host=https://codepen.io

Following your suggestion, I have tried adding an `id=` attribute to each _final color_ grid element, but that doesn’t seem to improve performance.

---

<div class="post-metadata">

**Author:** ![justinbmeyer](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/justinbmeyer/32/179_2.png) [@justinbmeyer](https://forums.bitovi.com/u/justinbmeyer)\
**Post date:** [November 10, 2018, 2:04am UTC](https://forums.bitovi.com/t/why-is-my-color-choosers-frame-rate-with-vue-so-much-higher-than-with-canjs/986/5 "2018-11-10T02:04:05Z")

</div>

This codepen doesn’t re-create the a `colors` list every time and instead mutates the values within it: [https://codepen.io/justinbmeyer/pen/yEGGoK?editors=1010](https://codepen.io/justinbmeyer/pen/yEGGoK?editors=1010)
