[riot-notifications] [RIOT-OS/RIOT] tests/periph_spi: add benchmark for acquire / release (#14108)

benpicco notifications at github.com
Wed May 20 17:57:51 CEST 2020


### Contribution description

Add a benchmark to test the performance of `spi_acquire()` / `spi_release()`

Also move the sched diff calculation to a helper function.

### Testing procedure

on `samr21-xpro`:

```
> init 1 0 1 0 0
> bench
2020-05-20 17:54:12,516 # ### Running some benchmarks, all values in [us] ###
2020-05-20 17:54:12,519 # ### Test				Transfer time	user time
2020-05-20 17:54:12,519 # 
2020-05-20 17:54:12,548 #  1 - write 1000 times 1 byte:			24238	24257
2020-05-20 17:54:12,597 #  2 - write 1000 times 2 byte:			45009	45028
2020-05-20 17:54:14,735 #  3 - write 1000 times 100 byte:		2129446	2129465
2020-05-20 17:54:14,788 #  4 - write 1000 times 1 byte to register:	48113	48132
2020-05-20 17:54:14,862 #  5 - write 1000 times 2 byte to register:	68946	68965
2020-05-20 17:54:17,024 #  6 - write 1000 times 100 byte to register:	2153405	2153424
2020-05-20 17:54:17,073 #  7 - read 1000 times 2 byte:			45196	45215
2020-05-20 17:54:19,210 #  8 - read 1000 times 100 byte:		2129634	2129653
2020-05-20 17:54:19,285 #  9 - read 1000 times 2 byte from register:	69134	69153
2020-05-20 17:54:21,448 # 10 - read 1000 times 100 byte from register:	2153509	2153528
2020-05-20 17:54:21,497 # 11 - transfer 1000 times 2 byte:		45134	45153
2020-05-20 17:54:23,635 # 12 - transfer 1000 times 100 byte:		2129613	2129632
2020-05-20 17:54:23,710 # 13 - transfer 1000 times 2 byte to register:	69071	69090
2020-05-20 17:54:25,872 # 14 - transfer 1000 times 100 byte to register:2153530	2153549
2020-05-20 17:54:25,890 # 15 - acquire/release 1000 times:		11321	11340
2020-05-20 17:54:26,893 # -- - SUM:					13275299	13275584
2020-05-20 17:54:26,894 # 
2020-05-20 17:54:26,896 # ### All runs complete ###
```


### Issues/PRs references

useful to test #14107

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/14108

-- Commit Summary --

  * tests/periph_spi: introduce _xtimer_diff_usec()
  * tests/periph_spi: add benchmark for acquire / release

-- File Changes --

    M tests/periph_spi/main.c (66)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/14108.patch
https://github.com/RIOT-OS/RIOT/pull/14108.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/14108
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200520/d46d8f91/attachment.htm>


More information about the notifications mailing list