Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Benchmarks for CircuitPython?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Benchmarks for CircuitPython?

by kevinjwalters on Sat Oct 10, 2020 7:50 am

Are there any benchmarks for CircuitPython? I noticed something in HackSpace recently (edition 34, page 67) and I was trying to reproduce the numbers in it which didn't look quite right to me for the two M4-based procesors mentioned, nRF52840 (64MHz) and SAMD51 (120MHz).

hackspace-34-p67-benchmarktable.png.png
CircuitPython FP benchmark table from HackSpace Edition 34 page 67
hackspace-34-p67-benchmarktable.png.png (46.41 KiB) Viewed 70 times


Here's some very simple floating point tests, primary use here being to compare performance across boards. The speed difference here looks appropriate given the clock speeds of the two M4 boards. ALL running CircuitPython 5.3.1.

Feather M4 Express

Code: Select all | TOGGLE FULL SIZE
Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit Feather M4 Express with samd51j19
>>>
>>> import simple_benchmarks
>>> simple_benchmarks.run()
platform: MicroChip SAMD51
version: 3.4.0
modules: {'simple_benchmarks': <module 'simple_benchmarks' from 'simple_benchmarks.py'>}
001AdditionA: 1.511477s (330802.226067Hz)
002MultiplicationA: 1.517326s (329526.972771Hz)
003DivisionA: 1.584962s (315464.997292Hz)
>>> simple_benchmarks.run()
platform: MicroChip SAMD51
version: 3.4.0
modules: {'simple_benchmarks': <module 'simple_benchmarks' from 'simple_benchmarks.py'>}
001AdditionA: 1.511183s (330866.622925Hz)
002MultiplicationA: 1.517409s (329509.019852Hz)
003DivisionA: 1.584792s (315498.876572Hz)


CLUE (alpha hardware)

Code: Select all | TOGGLE FULL SIZE
Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit CLUE nRF52840 Express with nRF52840
>>>
>>> import simple_benchmarks
>>> simple_benchmarks.run()
platform: nRF52840
version: 3.4.0
modules: {'simple_benchmarks': <module 'simple_benchmarks' from 'simple_benchmarks.py'>}
001AdditionA: 3.610917s (138468.933105Hz)
002MultiplicationA: 3.594544s (139099.681854Hz)
003DivisionA: 3.706118s (134912.061691Hz)
>>> simple_benchmarks.run()
platform: nRF52840
version: 3.4.0
modules: {'simple_benchmarks': <module 'simple_benchmarks' from 'simple_benchmarks.py'>}
001AdditionA: 3.612694s (138400.876999Hz)
002MultiplicationA: 3.606740s (138629.317284Hz)
003DivisionA: 3.705397s (134938.311577Hz)


Circuit Playground Express (CPX)

Code: Select all | TOGGLE FULL SIZE
Adafruit CircuitPython 5.3.1 on 2020-07-13; Adafruit CircuitPlayground Express with samd21g18
>>>
>>> import simple_benchmarks
>>> simple_benchmarks.run()
platform: Atmel SAMD21
version: 3.4.0
modules: {'simple_benchmarks': <module 'simple_benchmarks' from 'simple_benchmarks.py'>}
001AdditionA: 9.364471s (53393.297195Hz)
002MultiplicationA: 10.113869s (49437.060356Hz)
003DivisionA: 13.884789s (36010.622978Hz)
>>> simple_benchmarks.run()
platform: Atmel SAMD21
version: 3.4.0
modules: {'simple_benchmarks': <module 'simple_benchmarks' from 'simple_benchmarks.py'>}
001AdditionA: 9.364391s (53393.750191Hz)
002MultiplicationA: 10.113922s (49436.793327Hz)
003DivisionA: 13.884777s (36010.656357Hz)


Code is in https://github.com/kevinjwalters/circui ... chmarks.py

kevinjwalters
 
Posts: 764
Joined: Sun Oct 01, 2017 3:15 pm

Re: Benchmarks for CircuitPython?

by tannewt on Mon Oct 12, 2020 4:51 pm

We don't maintain or track any ourselves. Generally, it can be a bit of a trap because there is always performance to gain at an increasing cost.

I've tweeted at Hackspace about how they got their numbers: https://twitter.com/tannewt/status/1315754129206042624

tannewt
 
Posts: 1837
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.