# Reversing an array

**URL:** <https://forum.dfinity.org/t/reversing-an-array/12724>\
**Category:** Language Support\
**Tags:** Motoko\
**Created:** [May 4, 2022, 6:33pm UTC](https://forum.dfinity.org/t/reversing-an-array/12724 "2022-05-04T18:33:33Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![icme](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/icme/32/4327_2.png) [@icme](https://forum.dfinity.org/u/icme)\
**Post date:** [May 16, 2022, 4:49pm UTC](https://forum.dfinity.org/t/reversing-an-array/12724/21 "2022-05-16T16:49:56Z")

</div>

@skilesare  
Thank you for performance testing the StableRBTree, as well as the link to the Motoko playground code used!

I just verified that @claudio’s assumption of the test failure is correct on the main network.

If you delete line 20, the insertion performance of [StableRBTree](https://github.com/canscale/StableRBTree/blob/main/src/StableRBTree.mo) and [RBTree](https://github.com/dfinity/motoko-base/blob/master/src/RBTree.mo) are identical.

According to my understanding, [stable variables do not cost any more than regular variables in terms of read/write/storage. In fact, using stable data structures like StableRBTree is less expensive during upgrades](https://forum.dfinity.org/t/clarification-on-stable-types-with-examples/11075/5).

---

_[View the full topic](https://forum.dfinity.org/t/reversing-an-array/12724)._
