# Any method to reduce the calculation time on PS (PYNQ-z2)

**URL:** <https://discuss.pynq.io/t/any-method-to-reduce-the-calculation-time-on-ps-pynq-z2/3915>\
**Category:** Support\
**Created:** [March 28, 2022, 4:23am UTC](https://discuss.pynq.io/t/any-method-to-reduce-the-calculation-time-on-ps-pynq-z2/3915 "2022-03-28T04:23:16Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)\
**Post date:** [March 28, 2022, 10:14am UTC](https://discuss.pynq.io/t/any-method-to-reduce-the-calculation-time-on-ps-pynq-z2/3915/5 "2022-03-28T10:14:46Z")

</div>

As proof of this you can make a very quick check.

```python
import pynq
import numpy as np

#### Download your overlay here ####

# Declare test array, an 8-element array from 0 to 7
test_array = np.arange(0, 8, dtype=np.uint8)

#Assign test array to an 8-element (8-bit) pynq buffer
in_buff1 = pynq.allocate((8,), dtype=np.uint8)
in_buff1[:] = test_array

# Assign test array to a 1-element (64-bit) pynq buffer
in_buff2 = pynq.allocate((1,), dtype=np.uint64)
aux = 0;
for i in range(len(test_array)):
    aux += test_array[i] * 2**(i*8)
in_buff2[:] = aux

# Compare byte representation (this is how the elements are stored in memory)
print("Byte representation equal: {}".format(in_buff2.tobytes() == in_buff1.tobytes()))

```

Hope this helps  
Mario

---

_[View the full topic](https://discuss.pynq.io/t/any-method-to-reduce-the-calculation-time-on-ps-pynq-z2/3915)._
