# MMIO write is too slow

**URL:** <https://discuss.pynq.io/t/mmio-write-is-too-slow/389>\
**Category:** Support\
**Created:** [August 14, 2019, 10:41am UTC](https://discuss.pynq.io/t/mmio-write-is-too-slow/389 "2019-08-14T10:41:26Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![PeterOgden](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/peterogden/32/55_2.png) [@PeterOgden](https://discuss.pynq.io/u/PeterOgden)\
**Post date:** [August 14, 2019, 11:07am UTC](https://discuss.pynq.io/t/mmio-write-is-too-slow/389/2 "2019-08-14T11:07:39Z")

</div>

The quick fix is to use the underlying numpy array to write the data - instances the MMIO class as a `.array` which provides direct access to the registers. If I’m doing this I generally take a slice of the array containing the registers I want to update frequently and then I can just directly assign it.

```
input_registers = mmio.array[0x100:0x200] # address 0x400 to 0x800
input_registers[:] = input_data

```

This will be substantially faster than calling write for each entry separately

For even better performance you will want to use a DMA engine to pull the data directly out of the DDR memory. There’s some documentation on this at [on our readthedocs page](https://pynq.readthedocs.io/en/v2.4/pynq_libraries/dma.html).

Peter

---

_[View the full topic](https://discuss.pynq.io/t/mmio-write-is-too-slow/389)._
